how to control a servo

Dependencies:   Servo mbed

Fork of Servo_HelloWorld by Simon Ford

main.cpp

Committer:
Maggie17
Date:
2016-05-28
Revision:
2:6d90139fddb2
Parent:
1:40d2fd0b99e6
Child:
3:67e0dff40e71

File content as of revision 2:6d90139fddb2:

#include "mbed.h"   // this tells us to load mbed related functions
#include "Servo.h"  // library for the Servo

Servo myservo(p21);

// this code runs when the microcontroller starts up
int main() {    
    for(float p=0; p<1.0; p += 0.1) {
        
        // YOUR CODE HERE: start the Servo
        
        
        wait(0.2);
    }
}