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.
Fork of PID by
SigInterpreter.cpp
00001 #include "SigInterpreter.h" 00002 00003 AnalogIn emg1(A0); 00004 AnalogIn emg2(A1); 00005 AnalogIn emg3(A2); 00006 AnalogIn emg4(A3); 00007 00008 SigInterpreter::SigInterpreter() {} 00009 00010 double SigInterpreter::readValue(int sig) { 00011 // returns the amplitude of EMG signal 00012 if(sig > 4 || sig < 1) { // RIGHT 00013 // nope 00014 return 0.0; // check later of dit idd goeie shit is 00015 } if (sig == 1) { 00016 float input = emg1.read(); 00017 return filter(input); 00018 } 00019 if (sig == 2) { 00020 float input = emg2.read(); 00021 return filter(input); 00022 } 00023 if (sig == 3) { 00024 float input = emg3.read(); 00025 return filter(input); 00026 } 00027 if (sig == 4) { 00028 float input = emg4.read(); 00029 return filter(input); 00030 } 00031 return 0.0; 00032 } 00033 double SigInterpreter::filter(float input) { 00034 //filter the input) 00035 return 0.0; //default, return the filtered input 00036 }
Generated on Fri Jul 15 2022 02:13:13 by
1.7.2
