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 MODSERIAL QEI TextLCD mbed
Fork of TotalControlEmg2 by
main.cpp
- Committer:
- Bartvaart
- Date:
- 2015-10-09
- Revision:
- 17:cfe44346645c
- Parent:
- 16:8f175d2a472f
- Child:
- 18:eec0880fcded
File content as of revision 17:cfe44346645c:
#include "mbed.h" #include "HIDScope.h" #include "Filterdesigns.h" #include "Kalibratie.h" #include "MODSERIAL.h" //bugfix AnalogIn emg(A0); //Analog input van emg kabels HIDScope scope(2); //2 scopes Ticker EMGticker; MODSERIAL pc(USBTX, USBRX); //bugfix DigitalOut LedBlue(LED3); //Sample frequentie double Fs = 500; //Hz double t = 1/ Fs; // voor EMGticker bool readymax = 0; bool readymin = 0; void EMGfilter(){ //uitlezen emg signaal double u = emg.read(); double y = Filterdesigns(u); // pc.printf("%f \n",y); //bugfix // Plotten in HIDscope scope.set(0,u); //ongefilterde waarde naar scope 1 scope.set(1,y); //gefilterde waarde naar scope 2 scope.send(); //stuur de waardes naar HIDscope } int main(){ LedBlue = 1; Init(); double ymax = KalibratieMax(readymax); double ymin = KalibratieMin(readymin); pc.printf("ymax = %f en ymin = %f \n",ymax, ymin); //bugfix while(readymax == 1 && readymin == 1){ LedBlue = 0; EMGticker.attach(&EMGfilter, t); //500H while(1){} } }