Numero Uno / EMG

Dependents:   PID_VelocityExample TheProgram Passief_stuurprogramma Actief_stuurprogramma

Revision:
5:7873900f62da
Parent:
4:963e903c2236
Child:
6:49056e5ea42e
--- a/EMG.h	Mon Oct 12 16:15:33 2015 +0000
+++ b/EMG.h	Wed Oct 14 11:29:52 2015 +0000
@@ -33,7 +33,7 @@
 
 Ticker T1;
 volatile bool sample_go;
-
+volatile bool calibrate_go;
 
 InterruptIn cali_button(PTA4); // initialize interrupt button for calibration stuff
 double cali_fact1 = 8;
@@ -47,7 +47,13 @@
     y1 = fabs(y1); y2 = fabs(y2); y3 = fabs(y3); y4 = fabs(y4);
     y1 = lowpass1.step(y1)*cali_fact1; y2 = lowpass2.step(y2)*cali_fact2; y3 = lowpass3.step(y3)*cali_fact1; y4 = lowpass4.step(y4)*cali_fact1; // roughly normalize to a scale of 0 - 1, where 0 is minimum and 1 is roughly the maximum output of dennis.
 }
- 
+
+
+void calibratego()
+{
+    calibrate_go = 1;
+}
+
 void samplego() // ticker function, set flag to true every sample interval
 {
     sample_go = 1;
@@ -72,6 +78,7 @@
    }
    cali_fact1 = 1.0/cali_max1;
    cali_fact2 = 1.0/cali_max2;
+   calibrate_go = 0;
 }
 
 /*