Dependencies:   mbed

main.cpp

Committer:
Kaikestu
Date:
2010-01-27
Revision:
0:9f66525c89d7

File content as of revision 0:9f66525c89d7:

#include "mbed.h"
#include "Servo.h"

DigitalOut myled(LED2);
Servo motor (p21);

int main() {

int b = 0;

while (b !=2 ){

    motor.write(0.5);
    wait(3);
    
    motor.write(0); //full forward
    wait(1);
    motor.write(0.5);
    wait(1);
    myled = 1;
    
    wait(2);
    
    motor.write(0.88); //full bacward     
    wait(5);
    motor.write(0.5);
    wait(1);
    myled = 0;
    
    b = 2;
}

    while(1) {//FIN
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}