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: HIDScope mbed MODSERIAL QEI
main.cpp
- Committer:
- Alex_Kyrl
- Date:
- 2017-10-16
- Revision:
- 6:452e301a105a
- Parent:
- 5:4c27dea81e4c
- Child:
- 7:c17f5473f4e1
File content as of revision 6:452e301a105a:
#include "EMG.h" #include "Motor.h" #include "HIDScope.h" #include "MODSERIAL.h" //Initialize Analog EMG inputs EMG EMG_bi_r(A0); EMG EMG_bi_l(A1); EMG EMG_tri_r(A2); EMG EMG_tri_l(A3); HIDScope scope(1); // 4 channels of data Ticker MainTicker; MODSERIAL pc(USBTX, USBRX); const double sample_time= 0.002; //fs = 500Hz void ReadAndFilterEMG() { //Send scope data scope.set(0, EMG_bi_r.filter()); //Raw Data //scope.set(1, EMG_Filtered_1); //Notch and High Pass Filtered //scope.set(2, EMG_Abs_1); //Absolute value //scope.set(3, EMG_Envelope_1); //Envelope Detected output scope.send(); /*****/ } int main(void) { pc.baud(115200); //Set Baud rate for Serial communication MainTicker.attach(&ReadAndFilterEMG, sample_time); //Attach time based interrupt /* while(true) { } */ return 0; }