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 biquadFilter
Diff: main.cpp
- Revision:
- 1:7d218e9d2111
- Parent:
- 0:494acf21d3bc
- Child:
- 5:23c850380b86
--- a/main.cpp Mon Oct 31 13:05:53 2016 +0000 +++ b/main.cpp Wed Nov 02 09:11:19 2016 +0000 @@ -1,5 +1,49 @@ -//#include "arm.h" -// -//int main() { -// -//} \ No newline at end of file +#include "arm.h" + +// ====== Hardware stuff ====== + +const PinName upperMotorControl = D6; +const PinName upperMotorDirection = D7; +const PinName lowerMotorControl = D5; +const PinName lowerMotorDirection = D4; + +//Arm upperArm(50, upperMotorControl, upperMotorDirection); +//Arm lowerArm(50, lowerMotorControl, lowerMotorDirection); + +const PinName emg1pin = A0; +const PinName emg2pin = A1; + +AnalogIn emg1(emg1pin); +AnalogIn emg2(emg2Pin); + +//====== Types ===== + +enum DirectionState{UP = true, DOWN = false}; +enum ProgramState{CALIBRATING, RUNNING}; + +//====== Program Variables ====== + +ProgramState progState; +DirectionState dirState; + +float emg1threshold; +float emg2threshold; + +//====== Functions ====== + + +void calibrate(void) { + //Calibrate function. + //Blocks + +} + + +int main() { + progState = CALIBRATING; + calibrate(); + + + while(true); + return 0; +} \ No newline at end of file