Kurang Servo Flap

Dependencies:   Motor Servo_Test mbed

Fork of Servo_test by KRAI 2017

main.cpp

Committer:
Joshua23
Date:
2016-10-29
Revision:
0:ac3026899cce
Child:
1:d5adf9f6ca32

File content as of revision 0:ac3026899cce:

// Continuously sweep the servo through it's full range
#include "mbed.h"
#include "Servo.h"

Servo myservo(PC_8);

int main() {
    wait_ms(100);
    myservo.position(-90);
    wait_ms(2000);
    while(1) {
        for(int i=-90; i<=90; i++) {
            myservo.position(i);
            wait(0.01);
        }
        for(int i=90; i>-90; i--) {
            myservo.position(i);
            wait(0.01);
        }
    }
   
}