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.
Dependencies: mbed
Revision 4:0b614835f104, committed 2015-11-17
- Comitter:
- spin7ion
- Date:
- Tue Nov 17 10:44:40 2015 +0000
- Parent:
- 3:c5a79dbed82b
- Child:
- 5:d4e53f381e99
- Commit message:
- fixed timings
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 17 10:44:09 2015 +0000 +++ b/main.cpp Tue Nov 17 10:44:40 2015 +0000 @@ -6,7 +6,7 @@ DigitalOut myled(LED1); int main() { - int servopulsewidth=15000; + int servopulsewidth=1500; int signer=1; servo.period_us(20000); // servo requires a 20ms period @@ -17,13 +17,13 @@ while (1) { servopulsewidth+=signer; - if(signer>0 && servopulsewidth>19900){ + if(signer>0 && servopulsewidth>1990){ signer=-1; }else if(signer<0 && servopulsewidth<10){ signer=1; } servo.pulsewidth_us(servopulsewidth); servo2.pulsewidth_us(servopulsewidth); - wait(0.25); + wait(0.05); } }