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 QEI biquadFilter mbed
Fork of a_pid_kal_end_def by
Revision 7:42d0e38196f1, committed 2016-10-21
- Comitter:
- daniQQue
- Date:
- Fri Oct 21 13:43:43 2016 +0000
- Parent:
- 6:83358367e413
- Child:
- 8:cd0cb71b69f2
- Commit message:
- werkende versie, met abs, low, 1/0;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 21 13:34:24 2016 +0000
+++ b/main.cpp Fri Oct 21 13:43:43 2016 +0000
@@ -12,7 +12,9 @@
//define variables
double emg_0_value;
double emg_gefilterd;
-double emg_abs
+double emg_abs;
+int onoffsignal=0;
+double cut_off_value=0.05; //gespecifeerd door floortje
biquadFilter filterhigh1(-1.1430, 0.4128, 0.6389, -1.2779, 0.6389);
@@ -21,11 +23,17 @@
emg_gefilterd= filterhigh1.step(emg_0_value);
emg_abs=abs(emg_gefilterd);
led=!led;
-
+
+ if (emg_abs>cut_off_value)
+ {onoffsignal=1;}
+
+ else
+ {onoffsignal=0;}
+
//send signals to scope
scope.set(0, emg_0_value ); //set emg signal to scope in channel 1
scope.set(1, emg_gefilterd );
- scope.set(2, emg_abs);
+ scope.set(2, onoffsignal);
scope.send(); //send all the signals to the scope
}
