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:
- 15:95034d92bc76
- Parent:
- 14:1a695fc45fc6
- Child:
- 16:fa8001fef71b
diff -r 1a695fc45fc6 -r 95034d92bc76 main.cpp --- a/main.cpp Thu Oct 03 09:04:34 2019 +0000 +++ b/main.cpp Thu Oct 03 13:03:38 2019 +0000 @@ -4,6 +4,11 @@ #include "HIDScope.h" #include "MODSERIAL.h" #include "QEI.h" + +//Homebrew libraries + #include "header.h" + //#include "controller.cpp" + //Objects //LED @@ -22,7 +27,7 @@ InterruptIn button2(SW3); //button on the side opposite of the reset button //PC - Serial pc(USBTX,USBRX); + Serial pc(USBTX,USBRX); //Variables enum States {MovementIdle, CalibrationIdle, Demo, Startup, CalibrationPhysical, CalibrationEMG, Move, TiltCup, FailState}; @@ -41,9 +46,6 @@ Ticker Main_Ticker; Ticker Tick_Blinky;//used for the blinking of the leds - - - //Led FLicker void FlipLED(void) { @@ -111,7 +113,7 @@ } } // SW3 = button2 state changing -void Run_StateChangerButton2() +void Run_StateChangerButton2(void) { switch(CurrentState) { @@ -255,7 +257,10 @@ Main_Ticker.attach(mainloop,mainLoopT); wait(mainLoopT); Tick_Blinky.attach(FlipLED,ledFlipperT); - + + double PlantError = 1; + double k = 1; + double u = ControllerPID(PlantError, k); while(true) {