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 PID QEI biquadFilter mbed
Fork of cpfromralph by
Revision 30:2c67abcdb892, committed 2017-10-30
- Comitter:
- ralphg_92
- Date:
- Mon Oct 30 14:34:55 2017 +0000
- Parent:
- 29:09c1567d6148
- Child:
- 31:d346f9244b4a
- Commit message:
- now with 8 options, though unknown if it still works
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Oct 30 13:51:43 2017 +0000
+++ b/main.cpp Mon Oct 30 14:34:55 2017 +0000
@@ -192,31 +192,54 @@
/* Compare measurement to the calibrated value to decide actions */
- /* This part checks for right biceps contractions*/
+ /* This part checks for right biceps contractions only*/
if (maxpart1<emg1peak && maxpart2>emg2peak && maxpart3>emg3peak && maxpart4>emg4peak){
red = 1;
blue = 1;
green = 0;
}
- /* This part checks for left biceps contractions */
+ /* This part checks for left biceps contractions only*/
else if (maxpart1>emg1peak && maxpart2<emg2peak && maxpart3>emg3peak && maxpart4>emg4peak){
red = 0;
blue = 1;
green = 1;
}
- /* This part checks for left lower arm contractions */
+ /* This part checks for left lower arm contractions only*/
else if (maxpart1>emg1peak && maxpart2>emg2peak && maxpart3<emg3peak && maxpart4>emg4peak){
red = 1;
blue = 0;
green = 1;
}
-
- /* This part checks for right lower arm contractions */
+ /* This part checks for right lower arm contractions only */
else if (maxpart1>emg1peak && maxpart2>emg2peak && maxpart3>emg3peak && maxpart4<emg4peak){
red = 0;
blue = 1;
green = 0;
- }
+ }
+ /* This part checks for both lower arm contractions only */
+else if (maxpart1>emg1peak && maxpart2>emg2peak && maxpart3<emg3peak && maxpart4<emg4peak){
+ red = 0;
+ blue = 0;
+ green = 0;
+ }
+ /* This part checks for both biceps contractions only*/
+else if (maxpart1<emg1peak && maxpart2<emg2peak && maxpart3>emg3peak && maxpart4>emg4peak){
+ red = 0;
+ blue = 0;
+ green = 0;
+ }
+ /* This part checks for right lower arm & left biceps contractions only*/
+else if (maxpart1>emg1peak && maxpart2<emg2peak && maxpart3>emg3peak && maxpart4<emg4peak){
+ red = 0;
+ blue = 0;
+ green = 0;
+ }
+ /* This part checks for left lower arm & right biceps contractions only*/
+else if (maxpart1<emg1peak && maxpart2>emg2peak && maxpart3<emg3peak && maxpart4>emg4peak){
+ red = 0;
+ blue = 0;
+ green = 0;
+ }
else {
red = 1; /* Shut down all led colors if no movement is registered */
blue = 1;
