Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Servo_HelloWorld by
main.cpp@2:6d90139fddb2, 2016-05-28 (annotated)
- 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?
| User | Revision | Line number | New 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 | } |
