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:
- 3:3a9fdac2ba69
- Parent:
- 2:0a8622662f6d
- Child:
- 4:c7be673eb4a1
diff -r 0a8622662f6d -r 3a9fdac2ba69 main.cpp
--- a/main.cpp Thu Nov 01 08:10:21 2018 +0000
+++ b/main.cpp Thu Nov 01 08:46:04 2018 +0000
@@ -84,7 +84,7 @@
volatile double temp_highest_emg4 = 0;
//Doubles for calculation threshold
- double p_t;
+ double p_t; //set threshold at percentage of highest value
double threshold1;
double threshold2;
double threshold3;
@@ -201,10 +201,10 @@
tricepsL= false;
}
- pc.printf("Biceps Right = %d", bicepsR);
- pc.printf("Triceps Right = %d",tricepsR);
- pc.printf("Biceps Left = %d", bicepsL);
- pc.printf("Triceps Left = %d", tricepsL);
+ pc.printf("Biceps Right = %B", bicepsR);
+ pc.printf("Triceps Right = %B",tricepsR);
+ pc.printf("Biceps Left = %B", bicepsL);
+ pc.printf("Triceps Left = %B", tricepsL);
}
@@ -284,6 +284,7 @@
if (stateChanged)
{
// state initialization: green
+ t.reset();
t.start();
led1 = 0;
led2 = 1;
@@ -345,10 +346,10 @@
led1 = 1;
led2 = 0;
led3 = 0;
- pc.printf("De kleur is paars ok");
- //sample_ticker.attach(&threshold_check, ts);
- //sample_ticker.attach(&emgsample, ts);
-
+ wait(1);
+ sample_ticker.attach(&threshold_check, ts);
+ sample_ticker.attach(&emgsample, ts);
+
stateChanged = false;
}
