Ticker added

Dependencies:   HIDScope MODSERIAL QEI mbed

Fork of Tau_new_ticker_toevoegen by V D

Revision:
8:62c7083f12d9
Parent:
7:05bef8a64a44
Child:
9:23fa7b03e2fe
--- a/main.cpp	Thu Nov 02 09:30:04 2017 +0000
+++ b/main.cpp	Thu Nov 02 09:34:46 2017 +0000
@@ -33,7 +33,7 @@
 MODSERIAL pc(USBTX,USBRX);
 
 // Send angle to HIDScope and pc function
-void Measure()
+void Calculate()
 {
     // Get pulses and calculate angle
     pulse_count = Encoder.getPulses();
@@ -69,6 +69,10 @@
     //}   
 }
 
+void Measure()
+{
+    tick.attach(&Calculate, f);
+}
 
 // Roll function
 void Roll()
@@ -80,7 +84,8 @@
 
     // Turn motor on for x time and turn it off again
     motor1PWM = 1; // motor on
-    tick.attach(&Measure, f);
+    Measure();
+    
     
     //wait(3.00); // Let motor turn for x time    
 }