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: EMG1 PIDController1 compute mbed InBetweenController PinDetect QEI
main.cpp
- Committer:
- AeroKev
- Date:
- 2015-10-20
- Revision:
- 3:0634f55c2021
- Parent:
- 0:5f9d8f2142b6
- Child:
- 4:e021dacffa24
File content as of revision 3:0634f55c2021:
#include "mbed.h" #include "emg.h" #include "inbetweencontroller.h" #include "pidControl.h" // Define Objects Ticker sample_timer; double lastA; double lastB; void tick() { // EMG Reader double output0 = sample(0); double output1 = sample(1); double output2 = sample(2); // In Between Controller double nexta, nextb; newPos(output0, output2, output2, lastA, lastB, nexta, nextb); lastA = nexta; lastB = nextb; move(nexta,nextb); } int main() { init(); initialize(); // Attach a timer to the function 'Sample' which fires every 0.002 seconds. sample_timer.attach(&tick, 0.002); while(1) { } }