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: EMG1 PIDController1 compute mbed InBetweenController PinDetect QEI
Diff: main.cpp
- Revision:
- 18:ff312179cf44
- Parent:
- 17:b1d8c215b7ea
- Child:
- 19:7c356ec0fae0
--- a/main.cpp Thu Oct 29 17:47:35 2015 +0000 +++ b/main.cpp Fri Oct 30 09:49:12 2015 +0000 @@ -47,12 +47,12 @@ // Calculate the new position using the EMG output and the current position bool pushing; newPos(emg_out0, emg_out1, emg_out2, a, b, x, y, pushing); - // pc2.printf("O0: %f | O1: %f | O2: %f\r\n",emg_out0, emg_out1, emg_out2); Angles2Point(x,y,a,b); - - if (pushing) + if (pushing) { motorSpeed = 1; + pc2.printf("X: %f | Y: %f\r\n",a,b); + } else if(a < -20 || a > 20) motorSpeed = 0.14; else @@ -93,7 +93,7 @@ return; } started = !started; - if(started) { + if(!started) { pc2.printf("Stopped\r\n"); go_motor = false; PID_stop();