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:
- 10:ad2da21a102c
- Parent:
- 9:cb88b16a97d5
- Child:
- 11:32deb48774f7
--- a/main.cpp Wed Oct 02 07:41:41 2019 +0000 +++ b/main.cpp Wed Oct 02 13:49:25 2019 +0000 @@ -1,18 +1,37 @@ //Libraries -#include "mbed.h" - -//objects and variables -DigitalOut ledb(LED_BLUE); // ledb=true is led off!! -DigitalOut ledg(LED_GREEN); -DigitalOut ledr(LED_RED); + #include "mbed.h" + #include "FastPWM.h" + #include "HIDScope.h" + #include "MODSERIAL.h" + #include "QEI.h" -enum States {MovementIdle, CalibrationIdle, Demo, Startup, CalibrationPhysical, CalibrationEMG, Move, TiltCup, FailState}; -States CurrentState; +//Objects + //LED + DigitalOut ledb(LED_BLUE); // ledb=true & ledb=1 is led off!! + DigitalOut ledg(LED_GREEN); + DigitalOut ledr(LED_RED); + //Motors + + //Sensors + + //Buttons + InterruptIn button2(SW2); //button on the side of the reset button + InterruptIn button3(SW3); //button on the side opposite of the reset button -Ticker Main_Ticker; +//Variables + enum States {MovementIdle, CalibrationIdle, Demo, Startup, CalibrationPhysical, CalibrationEMG, Move, TiltCup, FailState}; + States CurrentState; + + volatile char ledcolor; //r is red, b is blue, g is green, t is bluegreen, p is purple + -char ledcolor; //r is red, b is blue, g is green, t is bluegreen, p is purple -Ticker Tick_Blinky;//used for the blinking of the leds + +//Tickers + Ticker Main_Ticker; + Ticker Tick_Blinky;//used for the blinking of the leds + + + //Led FLicker void FlipLED(void) @@ -48,32 +67,32 @@ void Run_Demo(void) { - + pc.prinf("Starting Demo ...\r\n") } void Run_MovementIdle(void) { - + pc.prinf("Starting Idle ...\r\n") } void Run_CalibrationIdle(void) { - + pc.prinf("Starting Calibration Idle ...\r\n") } void Run_Startup(void) { - + pc.prinf("Starting Startup ...\r\n") } void Run_CalibrationPhysical(void) { - + pc.prinf("Starting Calibration Physical ... \r\n") } void Run_CalibrationEMG(void) { - + pc.prinf("Starting Calibration EMG ... \r\n") } void Run_Move(void)