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:
- 1:74a29b62a144
- Parent:
- 0:916047fa0d8b
- Child:
- 2:812701011676
diff -r 916047fa0d8b -r 74a29b62a144 main.cpp --- a/main.cpp Wed Sep 17 15:17:24 2014 +0000 +++ b/main.cpp Sat Sep 20 06:50:43 2014 +0000 @@ -1,11 +1,32 @@ #include "mbed.h" -#include "PwmServo.h" +#include "ExtendedServo.h" DigitalOut myled(LED1); - - int main() { - + //PwmServo a(PB_8); + ExtendedServo b(PB_10, 170, 5, 90, false); + + while(1) { + // a.setAngle(54); + //b.setAngle(-90); + //wait_ms(2000); + b.setAngle(0); + //wait_ms(2000); + //b.setAngle(90); + //wait_ms(2000); + //b.setAngle(0); + //wait_ms(2000); + + for (int i = -90; i < 90 ;i++) { + b.setAngle(i); + wait_ms(10); + } + for (int i = 90; i > -90; i--) { + b.setAngle(i); + wait_ms(10); + } + + } }