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: HIDScope MODSERIAL QEI TextLCD mbed
Fork of TotalControlEmg2 by
Diff: main.cpp
- Revision:
- 42:18cb904dab56
- Parent:
- 41:91c8c39d7a33
- Child:
- 43:929cab5358ee
--- a/main.cpp Thu Oct 22 08:07:27 2015 +0000 +++ b/main.cpp Thu Oct 22 08:14:20 2015 +0000 @@ -15,7 +15,7 @@ PwmOut servo(D3); // PwmOut servo AnalogIn emgL(A0), emgR(A1); // Analog input of EMG, left and right AnalogIn potL(A2), potR(A3); // Potential meter left and right -AnalogIn ksLeft(A4), ksRight(A5); // Killswitch left and right +DigitalIn ksLeft(PTE24), ksRight(PTE25); // Killswitch left and right HIDScope scope(2); // Hidscope, amount of scopes Ticker EMGticker, tickerControl, tickerBreak, tickerLcd; // Ticker for EMG, regulator and break // QEI Encoder(port 1, port 2, ,counts/rev @@ -144,7 +144,7 @@ breakFlag = true; } void checkAim(){ // check if Killswitch is on or max counts is reached - if((ksRight.read() > 0.8) || (ksLeft.read() > 0.8)){ + if((ksRight.read()) || (ksLeft.read())){ if(pwmM1.read()>0){ // Aim motor is running pwmM2.write(0); // Aim motor freeze pc.printf("BOEM! CRASH! KASTUK!\r\n"); // Terminal @@ -233,7 +233,7 @@ if(controlFlag){ // motor regelen op GoFlag controlFlag = false; if(!calibrated){ // Not calibrated - if((ksRight.read() > 0.8)){ // Killswitch? + if((ksRight.read())){ // Killswitch? pwmM2.write(0); // Aim motor freeze enc2.reset(); // Reset encoder PRINT("Aim calibrated"); // LCD