kalibratie stappen project EMG
Dependencies: HIDScope MODSERIAL biquadFilter mbed
Fork of Milestone_sample by
Diff: main.cpp
- Revision:
- 18:898f54c6aa3d
- Parent:
- 17:741798018c0d
- Child:
- 19:466ada92bf65
diff -r 741798018c0d -r 898f54c6aa3d main.cpp --- a/main.cpp Mon Oct 22 12:12:27 2018 +0000 +++ b/main.cpp Mon Oct 22 12:48:44 2018 +0000 @@ -38,7 +38,7 @@ double movAg0,movAg1,movAg2; //outcome of MovAg //calibration -int x = 0; +static int x = -1; int emg_cal = 0; const int sizeCal = 2000; double StoreCal0[sizeCal], StoreCal1[sizeCal], StoreCal2[sizeCal]; @@ -155,7 +155,7 @@ ledb = 1; ledg = 0; } - else //If x > 3, led is white + else //If x = 3, led is white { ledr = 0; ledb = 0; @@ -180,7 +180,7 @@ { StoreCal0[j] = emgfilter0; sum+=StoreCal0[j]; - wait(0.001f); + //wait(0.001f); } Mean0 = sum/sizeCal; Threshold0 = Mean0/2; @@ -193,7 +193,7 @@ { StoreCal1[j] = emgfilter1; sum+=StoreCal1[j]; - wait(0.001f); + //wait(0.001f); } Mean1 = sum/sizeCal; Threshold1 = Mean1/2; @@ -206,7 +206,7 @@ { StoreCal1[j] = emgfilter2; sum+=StoreCal2[j]; - wait(0.001f); + //wait(0.001f); } Mean2 = sum/sizeCal; Threshold2 = Mean2/2; @@ -215,7 +215,7 @@ case 3: //EMG is calibrated, robot can be set to Home position. { emg_cal = 1; - wait(0.001f); + //wait(0.001f); break; } default: //Ensures nothing happens if x is not 0,1 or 2.