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 mytest by
Revision 0:0bfea7dbf107, committed 2013-02-11
- Comitter:
- screamer
- Date:
- Mon Feb 11 17:38:26 2013 +0000
- Commit message:
- test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 0bfea7dbf107 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Feb 11 17:38:26 2013 +0000 @@ -0,0 +1,13 @@ +#include "mbed.h" + +PwmOut servo(p21); + +int main() { + servo.period(0.020); // servo requires a 20ms period + while (1) { + for(float offset=0.0; offset<0.001; offset+=0.0001) { + servo.pulsewidth(0.001 + offset); // servo position determined by a pulsewidth between 1-2ms + wait(0.25); + } + } +} \ No newline at end of file