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:
- 9:45ae94cf5e23
- Parent:
- 8:f2b6ef8c5eb8
- Child:
- 10:1637fce7ef1e
--- a/main.cpp Tue Nov 19 12:17:42 2019 +0000 +++ b/main.cpp Tue Nov 19 13:01:34 2019 +0000 @@ -76,6 +76,8 @@ //Reset timer and Start timer.reset(); timer.start(); + timer1.reset(); + timer1.start(); //********************************************************************* //FIRST TIME - SYNCHRONISE (YOU SHOULD NOT NEED THIS ONCE IT's RUNNING) //********************************************************************* @@ -129,7 +131,6 @@ int main() { - timer1.reset(); //Configure the terminal to high speed terminal.baud(115200); @@ -162,38 +163,37 @@ //Main polling loop while(1) { - timer1.start(); while(trav <= 1250) { PWMA.write(dutyA); //Set duty cycle y PWMB.write(dutyB); time(); } - while(trav <= 1331) + while(trav <= 330) { PWMA.write(dutyA); PWMB.write(0.0f); time(); } - while(trav <= 2788) + while(trav <= 1457) { PWMA.write(dutyA); PWMB.write(dutyB); time(); } - while(trav <= 3544) + while(trav <= 268) { PWMA.write(dutyA); PWMB.write(0.0f); time(); } - while(trav <= 4294) + while(trav <= 750) { PWMA.write(dutyA); PWMB.write(dutyB); time(); } - while(trav <= 4963) + while(trav <= 200) { PWMA.write(dutyA); PWMB.write(0.0f);