Robotics Kit Workshop
/
Program3_Servo
how to control a servo
Fork of Servo_HelloWorld by
Revision 2:6d90139fddb2, committed 2016-05-28
- Comitter:
- Maggie17
- Date:
- Sat May 28 04:28:06 2016 +0000
- Parent:
- 1:40d2fd0b99e6
- Child:
- 3:67e0dff40e71
- Commit message:
- add the comments
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 23 16:10:35 2010 +0000 +++ b/main.cpp Sat May 28 04:28:06 2016 +0000 @@ -1,13 +1,15 @@ -// Hello World to sweep a servo through its full range - -#include "mbed.h" -#include "Servo.h" +#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) { - myservo = p; + + // YOUR CODE HERE: start the Servo + + wait(0.2); } }