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 QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 12:d13ce121a781
- Parent:
- 11:32deb48774f7
- Child:
- 13:f90e31c6af2b
--- a/main.cpp Wed Oct 02 14:48:39 2019 +0000 +++ b/main.cpp Thu Oct 03 07:35:27 2019 +0000 @@ -96,6 +96,21 @@ } } +void Run_StateChangerButton2() +{ + switch(CurrentState) + { + case CalibrationIdle: + CurrentState = Demo; + case MovementIdle: + CurrentState = Move; + break; + case TiltCup: + CurrentState = MovementIdle; + break; + } +} + void Run_Demo(void) { pc.printf("Starting Demo ...\r\n"); @@ -104,21 +119,16 @@ void Run_MovementIdle(void) { pc.printf("Starting Idle ...\r\n"); - //button1.rise(Run_StateChangerButton1); - //button2.rise(CurrentState = Move); } void Run_CalibrationIdle(void) { pc.printf("Starting Calibration Idle ...\r\n"); - //button1.rise(Run_StateChangerButton1); - //button2.rise(CurrentState = Demo); } void Run_Startup(void) { pc.printf("Starting Startup ...\r\n"); - //button1.rise(Run_StateChangerButton1); } void Run_CalibrationPhysical(void) @@ -132,20 +142,16 @@ void Run_CalibrationEMG(void) { pc.printf("Starting Calibration EMG ... \r\n"); - //button1.rise(Run_StateChangerButton1); } void Run_Move(void) { pc.printf("Starting Calibration Move ... \r\n"); - //button1.rise(Run_StateChangerButton1); } void Run_TiltCup(void) { pc.printf("Starting Calibration TiltCup ... \r\n"); - //button1.rise(Run_StateChangerButton1); - //buttone2.ruse(CurrentState = FailState); } void Run_FailState(void) @@ -200,6 +206,9 @@ ledcolor='t'; Run_FailState(); break; + default: + ledcolor='r'; + break; } } @@ -222,6 +231,8 @@ button1.mode(PullUp); button1.rise(Run_StateChangerButton1); button2.mode(PullUp); + button2.rise(Run_StateChangerButton2); + while(true) {