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:
- 4:e021dacffa24
- Parent:
- 3:0634f55c2021
- Child:
- 5:5339a7be9fb7
File content as of revision 4:e021dacffa24:
#include "mbed.h" #include "emg.h" #include "inbetweencontroller.h" #include "pidControl.h" // Define Objects Ticker sample_timer; void tick() { // EMG Reader double output0 = sample(0); double output1 = sample(1); double output2 = sample(2); // In Between Controller double lastA, lastB, nextA, nextB; getCurrent(lastA, lastB); newPos(output0, output2, output2, lastA, lastB, nextA, nextB); // Rotate the motors 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) { } }