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
main.cpp
- Committer:
- Jankoekenpan
- Date:
- 2016-11-02
- Revision:
- 1:7d218e9d2111
- Parent:
- 0:494acf21d3bc
- Child:
- 5:23c850380b86
File content as of revision 1:7d218e9d2111:
#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; }