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 biquadFilter mbed
Diff: main.cpp
- Revision:
- 1:7fb4a74d33ff
- Parent:
- 0:ae0bec143f2d
- Child:
- 2:13fa37643b8a
- Child:
- 3:cdac0bfafc80
--- a/main.cpp Mon Oct 24 11:16:02 2016 +0000
+++ b/main.cpp Mon Oct 24 18:34:06 2016 +0000
@@ -27,9 +27,12 @@
//Timeout to change state after 5 seconds
Timeout change_state;
-//Timeout to change state after 10 seconds
+//Timeout to change state after 15 seconds
Timeout change_state2;
+//LED
+DigitalOut led(LED_RED);
+
//Emg input
AnalogIn emg0( A0 );
AnalogIn emg1( A1 );
@@ -69,10 +72,12 @@
void calibrate() {
state = STATE_CALIBRATION;
+ led.write(0);
}
void run() {
state = STATE_RUN;
+ led.write(1);
}
void EMG_filter();
@@ -81,9 +86,10 @@
//combine biquads in biquad chains for notch/high- low-pass filters
notch_50.add( &bq1 ).add( &bq2 ).add( &bq3 );
high_pass.add( &bq4 ).add( &bq5 );
+ led.write(1);
change_state.attach( &calibrate,5);
- change_state2.attach( &run,10);
+ change_state2.attach( &run,15);
emgSampleTicker.attach( &emgSample, 0.002);
while( true ){
if(go_emgSample == true){