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: biquadFilter MODSERIAL QEI mbed
Fork of StateMachineEMGisAFditisemcasper1643 by
Diff: main.cpp
- Revision:
- 6:f55ab7e38a7f
- Parent:
- 5:19f59a855475
- Child:
- 7:88fa84742b3c
--- a/main.cpp Thu Nov 01 15:29:32 2018 +0000
+++ b/main.cpp Thu Nov 01 15:40:37 2018 +0000
@@ -64,13 +64,6 @@
emg3_filtered = lowp3.step(emg3_abs);
emg4_filtered = lowp4.step(emg4_abs);
-
- //Send data to HIDScope
- //scope.set(0,emg1_filtered ); ONLY FOR VISUALIZATION
- //scope.set(1,emg2_filtered);
- //scope.set(2,emg3_filtered);
- //scope.set(3,emg4_filtered);
- //scope.send();
}
@@ -85,7 +78,8 @@
volatile double temp_highest_emg4 = 0;
//Doubles for calculation threshold
- double p_t = 0.4; //set threshold at percentage of highest value
+ double biceps_p_t = 0.4; //set threshold at percentage of highest value
+ double triceps_p_t = 0.5; //set threshold at percentage of highest value
volatile double threshold1;
volatile double threshold2;
volatile double threshold3;
@@ -163,10 +157,10 @@
pc.printf("Highest value left triceps= %f \r\n", temp_highest_emg4);
- threshold1 = temp_highest_emg1*p_t;
- threshold2 = temp_highest_emg2*p_t;
- threshold3 = temp_highest_emg3*p_t;
- threshold4 = temp_highest_emg4*p_t;
+ threshold1 = temp_highest_emg1*biceps_p_t; //Right Biceps
+ threshold2 = temp_highest_emg2*triceps_p_t; //Right Triceps
+ threshold3 = temp_highest_emg3*biceps_p_t; //Left Biceps
+ threshold4 = temp_highest_emg4*triceps_p_t; //Left Triceps
}
//Check if emg_filtered has reached their threshold
