Bibliothèque des éléments du robot

Dependencies:   CMPS03 CNY70 GP2A PID Pixy RC_Servo VMA306 mbed

Revision:
5:6afed0e241cb
Parent:
4:5038b4cd1088
Child:
7:6d58adc26b78
--- a/main.cpp	Tue Jun 05 07:29:54 2018 +0000
+++ b/main.cpp	Tue Jun 05 08:02:56 2018 +0000
@@ -10,7 +10,7 @@
 #define PI  3.1415926535898
 
 Serial      pc          (PA_2, PA_3, 921600);
-PID         motor       (TIM4, TIM3, PA_9, PA_8, PC_9, PC_8, PC_6, PC_5);
+//PID         motor       (TIM4, TIM3, PA_9, PA_8, PC_9, PC_8, PC_6, PC_5);
 
 CMPS03      boussole    (PC_4);
 
@@ -47,7 +47,7 @@
     led2 = 0;
     disquette = 0;
     
-    motor.resetPosition();
+    //motor.resetPosition();
 
     wait (5);
 
@@ -67,7 +67,7 @@
         pc.printf("\rGP2 courte distance = %5.2f\n",sd1.getDistance ());
 
         pc.printf("\rpos = %2.1lf\n",pos);
-        /*ballon.write (pos);
+        ballon.write (pos);
         verrou.write (pos);
         nbiter++;
         if (nbiter%5==0) {
@@ -78,7 +78,7 @@
                 pos-=0.1;
                 if (pos<0.1) sens = 1;
             }
-        }*/
+        }
 
         if (UltraSon.isUSGReady())     pc.printf ("\rusG = %5.2lf -", UltraSon.readUSG());
         if (UltraSon.isUSBReady())     pc.printf ("\r\t\t usB = %5.2lf -", UltraSon.readUSB());
@@ -101,7 +101,7 @@
         }
 
         // Square danse !!!
-        motor.getPosition (&x,&y, &theta);
+        /*motor.getPosition (&x,&y, &theta);
         switch (etatmvt) {
             case 0 :
                 // On avance de 50cm (coordonnés X = 500, Y = 0)
@@ -144,7 +144,7 @@
                 if (theta <= 0) etatmvt = 0;
                 break;
         }
-
+*/
         pc.printf ("\n");
         led1 = !led1;
         led2 = !led2;