V0.1

Dependencies:   mbed QEI

Fork of motor_calibration by Kenneth Weisbeek

Revision:
10:4d5af6e84c7a
Parent:
9:6672bbf14f7a
--- a/main.cpp	Wed Oct 31 18:25:31 2018 +0000
+++ b/main.cpp	Wed Oct 31 18:36:38 2018 +0000
@@ -5,9 +5,9 @@
 /* THIS IS IMPLEMENTED IN THE BIG CODE, DO NOT CHANGE IT HERE, BUT THERE!!! */
 
 //initial allocations
-DigitalOut dirpin(D4); // for translatie
+DigitalOut dirpin_1(D4); // for translatie
 DigitalOut dirpin_2(D7); // for rotatie
-PwmOut pwmpin(D5);
+PwmOut pwmpin_1(D5);
 PwmOut pwmpin_2(D6);
 QEI Encoder1(D12,D13,NC,64,QEI::X4_ENCODING);
 QEI Encoder2(D10,D11,NC,64,QEI::X4_ENCODING);
@@ -30,7 +30,7 @@
 float speed = 0.70;
 int dir = 0;
 
-// Functions (2 functions not finished)
+// Functions 
 int Counts1(volatile int& a) // a = counts1
 {
     counts1_prev = a;
@@ -61,14 +61,14 @@
 // Start translation   
 void translation_start(int a, float b) // a = dir , b = speed 
 { 
-    dirpin.write(a);
-    pwmpin = b;
+    dirpin_1.write(a);
+    pwmpin_1 = b;
     }
     
 // Stop translation                            
 void translation_stop()
 { 
-    pwmpin = 0.0;
+    pwmpin_1 = 0.0;
     }
     
 // Start rotation