Robotics Kit Workshop / Mbed 2 deprecated Program3_Servo

Dependencies:   Servo mbed

Fork of Servo_HelloWorld by Simon Ford

Committer:
Maggie17
Date:
Sat May 28 04:28:06 2016 +0000
Revision:
2:6d90139fddb2
Parent:
1:40d2fd0b99e6
Child:
3:67e0dff40e71
add the comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Maggie17 2:6d90139fddb2 1 #include "mbed.h" // this tells us to load mbed related functions
Maggie17 2:6d90139fddb2 2 #include "Servo.h" // library for the Servo
simon 1:40d2fd0b99e6 3
simon 1:40d2fd0b99e6 4 Servo myservo(p21);
simon 1:40d2fd0b99e6 5
Maggie17 2:6d90139fddb2 6 // this code runs when the microcontroller starts up
simon 1:40d2fd0b99e6 7 int main() {
simon 1:40d2fd0b99e6 8 for(float p=0; p<1.0; p += 0.1) {
Maggie17 2:6d90139fddb2 9
Maggie17 2:6d90139fddb2 10 // YOUR CODE HERE: start the Servo
Maggie17 2:6d90139fddb2 11
Maggie17 2:6d90139fddb2 12
simon 1:40d2fd0b99e6 13 wait(0.2);
simon 1:40d2fd0b99e6 14 }
simon 1:40d2fd0b99e6 15 }