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 mbed-dsp mbed
Fork of emg_filter by
Diff: EMGfilter.cpp
- Revision:
- 27:24e73fd36859
- Parent:
- 26:b93c82fb6e1d
- Child:
- 29:f54123765a47
--- a/EMGfilter.cpp Fri Oct 17 08:32:39 2014 +0000
+++ b/EMGfilter.cpp Fri Oct 17 08:38:15 2014 +0000
@@ -8,6 +8,7 @@
AnalogIn emgT(PTB1); //Analog input tricep
float filtered_emgB;
+float filtered_emgT;
MODSERIAL pc(USBTX,USBRX);
@@ -67,7 +68,7 @@
{
/*variable to store value in*/
uint16_t emg_valueT;
- float filtered_emgT;
+
float emg_value_f32T;
/*put raw emg value both in red and in emg_value*/
emg_valueT = emgT.read_u16(); // read direct ADC result, converted to 16 bit integer (0..2^16 = 0..65536 = 0..3.3V)
@@ -79,8 +80,8 @@
arm_biquad_cascade_df1_f32(&lowpass, &filtered_emgT, &filtered_emgT, 1 );
/*send value to PC. */
- scope.set(0,emg_valueT); //uint value
- scope.set(1,filtered_emgT); //processed float
+ scope.set(2,emg_valueT); //uint value
+ scope.set(3,filtered_emgT); //processed float
scope.send();
}
