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.
Diff: main.cpp
- Revision:
- 0:3a1d19a1056a
diff -r 000000000000 -r 3a1d19a1056a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 20 19:39:42 2018 +0000 @@ -0,0 +1,30 @@ + // Continuously sweep the servo through it's full range + #include "mbed.h" + #include "Servo.h" + + Servo myservo(PB_3); + + int main() { + while(1) { + myservo.write(0.5); + wait(1); + myservo.write(1); + wait(1); + myservo.write(1.5); + wait(1); + myservo.write(2); + wait(1); + /*for(int i=0; i<200; i++) { + myservo = i/100.0; + wait(0.01); + } + for(int i=200; i>100; i--) { + myservo = i/100.0; + wait(0.01); + } + for(int i=100; i>0; i--) { + myservo = i/100.0; + wait(0.01); + }*/ + } + } \ No newline at end of file