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
Diff: main.cpp
- Revision:
- 5:19f8766b63da
- Parent:
- 4:61bdf601e7b0
- Child:
- 6:d03e4fa3a2a5
--- a/main.cpp Fri Jan 08 11:55:49 2016 +0000 +++ b/main.cpp Wed Jan 13 09:09:22 2016 +0000 @@ -92,6 +92,18 @@ arm_biquad_casd_df1_inst_f32 bandstop_triceps; arm_biquad_casd_df1_inst_f32 bandstop_pect; arm_biquad_casd_df1_inst_f32 bandstop_deltoid; +/* +//200hz sampling test + +//lowpass 1 filter settings: Fc = 90 Hz, Fs = 200 Hz, Gain = -3 dB +//lowpass 2 filter settings: Fc = 0.8 Hz, Fs = 200 Hz, Gain = -3 dB +float lowpass1_const[] = {0.800592403464570, 1.60118480692914,0.800592403464570,-1.56101807580072,-0.641351538057563}; +float lowpass2_const[] = {0.000155148423475699, 0.000310296846951398, 0.000155148423475699,1.96446058020523,-0.965081173899135}; +//highpass filter settings: Fc = 10 Hz, Fs = 200 Hz +float highpass_const[] = {0.800592403464570, -1.60118480692914, 0.800592403464570,1.56101807580072 ,-0.641351538057563}; +//bandstop filter settings Fc=[45Hz 55Hz], Fs= 200Hz +float bandstop_const[] = {0.800592403464570, -9.80442924324572e-17, 0.800592403464570,-0.201669174120189,-0.800844265795519 , 1,-1.22464679914735e-16 , 1 ,0.201669174120189,-0.800844265795519}; +*/ //lowpass 1 filter settings: Fc = 49 Hz, Fs = 100 Hz, Gain = -3 dB //lowpass 2 filter settings: Fc = 0.8 Hz, Fs = 100 Hz, Gain = -3 dB @@ -239,10 +251,10 @@ //speed_old1 = speed1; if (emg_y > 0) { - Diry = 1; + Diry = 0; } if (emg_y < 0) { - Diry = 0; + Diry = 1; } /*//Speed limit if (speed2 > 1) { @@ -296,10 +308,10 @@ speed_old2 = speed2; */ if (emg_x > 0) { - Dirx = 1; + Dirx = 0; } if (emg_x < 0) { - Dirx = 0; + Dirx = 1; } /*//Speed limit if (speed2 > 1) { @@ -413,7 +425,7 @@ looptimer1.attach(looper_motorx, 0.01); //X-Spindle motor - //looptimer2.attach(looper_motory, 0.01); //Y-Spindle motor + looptimer2.attach(looper_motory, 0.01); //Y-Spindle motor while(1){}; } \ No newline at end of file