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.
main.cpp
- Committer:
- CSTritt
- Date:
- 2021-05-06
- Revision:
- 3:600b3ff627a2
- Parent:
- 2:7709000dbbc4
File content as of revision 3:600b3ff627a2:
/*
Program MyServo_HelloWorld
Hello World to sweep a servo through its full range. Based on example by
Simon Ford. Minor modifications by Dr. C. S. Tritt.
Last revised 5/5/21 ( v. 0.9)
*/
#include "mbed.h"
#include "Servo.h"
Servo myServo(D8);
int main() {
for (int q=1; q < 6; q++) {
for (double p = 0; p < 1.0; p += 0.05) {
myServo = p;
wait(0.1);
}
}
while (true) {
float hold = 0.5;
myServo = hold; // Wait here forever.
wait(1.0);
}
}