new fork sure
Dependencies: HIDScope MODSERIAL PID QEI biquadFilter mbed
Fork of cpfromralph by
Diff: main.cpp
- Revision:
- 30:2c67abcdb892
- Parent:
- 29:09c1567d6148
- Child:
- 31:d346f9244b4a
diff -r 09c1567d6148 -r 2c67abcdb892 main.cpp --- 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;