Programme de test à priori fonctionnel avec la version 2018 de la carte

Dependencies:   PwmIn mbed Encoder_Nucleo_16_bits

Revision:
10:c6db803927b6
Parent:
9:2d99e9946b89
Child:
11:df0957bf8f16
--- a/main.cpp	Wed Oct 23 09:30:24 2019 +0000
+++ b/main.cpp	Wed Oct 23 09:56:01 2019 +0000
@@ -172,7 +172,7 @@
  */
 
 Serial      Pixy    (PA_0, PA_1, 230400);
-Serial      Pc      (PA_2, PA_3, 921600);
+Serial      Pc      (PA_2, PA_3, 115200);
 
 AnalogIn    SD2     (PA_4);
 AnalogIn    CNY1    (PA_7);
@@ -715,16 +715,18 @@
                 Pc.printf ("\n\n\rMoteur Gauche\n");
                 Pc.printf ("\rAppuyez sur Entree pour quitter\n");
 
-                if (SensG) {
-                    IN1G = 1;
-                    IN2G = 0;
-                } else {
-                    IN1G = 0;
-                    IN2G = 1;
-                }
+                
                 Led2 = 1;
 
                 do {
+                    if (SensG) {
+                    IN1G = 1;
+                    IN2G = 0;
+                    } else {
+                        IN1G = 0;
+                        IN2G = 1;
+                    }
+                    
                     if (FlagTickLed) {
                         Led1 = !Led1;
                         FlagTickLed = 0;
@@ -770,16 +772,17 @@
                 Pc.printf ("\n\n\rMoteur Droit\n");
                 Pc.printf ("\rAppuyez sur Entree pour quitter\n");
 
-                if (SensD) {
-                    IN1D = 1;
-                    IN2D = 0;
-                } else {
-                    IN1D = 0;
-                    IN2D = 1;
-                }
+               
                 Led2 = 1;
 
                 do {
+                     if (SensD) {
+                    IN1D = 1;
+                    IN2D = 0;
+                    } else {
+                        IN1D = 0;
+                        IN2D = 1;
+                    }
                     if (FlagTickLed) {
                         Led1 = !Led1;
                         FlagTickLed = 0;