Tuk workshop

Dependencies:   mbed RC_Servo VMA306 PID CNY70 CMPS03 GP2A Pixy

Revision:
9:4053b5217339
Parent:
8:2d4887624f94
Child:
10:6c3653c53eca
diff -r 2d4887624f94 -r 4053b5217339 main.cpp
--- a/main.cpp	Thu Oct 24 13:21:27 2019 +0000
+++ b/main.cpp	Thu Oct 24 14:21:22 2019 +0000
@@ -2,7 +2,6 @@
 #include "CMPS03.h"
 #include "CNY70.h"
 #include "GP2A.h"
-#include "RC_Servo.h"
 #include "VMA306.h"
 #include "Pixy.h"
 #include "PID.h"
@@ -37,9 +36,21 @@
 
 Timer       temps;
 
-main ()
+int main ()
 {
+    motor.resetPosition();
+    double x=0, y, theta = 0;
 
     while (1) {
+        double speed_L = 50, speed_R = 50;
+        while (x <= 200)
+        {
+            motor.setSpeed(speed_L,speed_R);
+            motor.getPosition(&x, &y, &theta);
+            pc.printf("\r x = %lf", x);
+        } 
+        motor.setSpeed(0,0);
     }
+    
+    return 0;
 }
\ No newline at end of file