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: Encoder MODSERIAL mbed
Diff: main.cpp
- Revision:
- 4:8344a3edd96c
- Parent:
- 3:c4df318913b8
- Child:
- 5:512dd4044486
--- a/main.cpp Wed Oct 30 08:41:50 2013 +0000 +++ b/main.cpp Wed Oct 30 08:54:12 2013 +0000 @@ -55,8 +55,8 @@ float setpoint_rechtsonderB; /* variable to store pwm value in*/ float pwm_to_motorA; - float pwm_to_begin_motorA; - float pwm_to_begin_motorB; + float pwm_to_begin_motorA = 0; + float pwm_to_begin_motorB = 0; float pwm_to_motorB; float pwm_to_rechtsonder_motorA; float pwm_to_rechtsonder_motorB; @@ -140,8 +140,8 @@ motorA.setPosition(0); pwm_motorA.write(0); - Ticker looptimer2; - looptimer2.attach(setlooptimerflag,0.01); + //Ticker looptimer2; + //looptimer2.attach(setlooptimerflag,0.01); while(pwm_to_begin_motorB >= 0) { while(looptimerflag != true); @@ -194,8 +194,10 @@ //} - Ticker looptimer3; - looptimer3.attach(setlooptimerflag,0.01); + //Ticker looptimer3; + //looptimer3.attach(setlooptimerflag,0.01); + //looptimer3.detach(); + while((pwm_to_begin_motorA >= 0)&&(pwm_to_begin_motorB >= 0)) { while(looptimerflag != true); @@ -226,8 +228,8 @@ /*Create a ticker, and let it call the */ /*function 'setlooptimerflag' every 0.01s */ - Ticker looptimer; - looptimer.attach(setlooptimerflag,0.01); + //Ticker looptimer; + //looptimer.attach(setlooptimerflag,0.01); //INFINITE LOOP while(1) {