7Robot_Freescale / Mbed 2 deprecated freescal_cup_k22f

Dependencies:   mbed freescal_cup_k22f

Dependents:   freescal_cup_k22f

Revision:
20:24ebe046ebe9
Parent:
17:31e000d82b21
Child:
21:9430357e777c
--- a/source/main.cpp	Sat Jan 17 13:32:39 2015 +0000
+++ b/source/main.cpp	Sat Jan 17 16:51:33 2015 +0000
@@ -19,7 +19,8 @@
  // Initialisation
  
     int indexMin=0;   
-    int indexMax=128;  
+    int indexMax=128;
+    int compteur_uart=0;
     int max_detect=indexMin;
     float Kp_servo = 0;
     uart.baud(115200); 
@@ -32,20 +33,35 @@
     while(1){
         
         readline();
-        passebas(12);
-        derivation();
+        //passebas(12);
+        //derivation();
         //passebas(4); 
            
-        uart.printf("S");//debug START
-        for (int indice_pixel=0; indice_pixel<128; indice_pixel++)   
-        {
-            uart.printf("%d,",pixel[indice_pixel]);
+           
+        if (compteur_uart ==50) // on envoit une trame toute les 50 acquisitions de cameras
+        {  
+            uart.printf("S1");//debug START
+            for (int indice_pixel=0; indice_pixel<128; indice_pixel++)   
+            {
+                uart.printf("%d,",pixel1[indice_pixel]);
+            }
+            uart.printf("E");//debug END
+            
+            uart.printf("S2");//debug START
+            for (int indice_pixel=0; indice_pixel<128; indice_pixel++)   
+            {
+                uart.printf("%d,",pixel2[indice_pixel]);
+            }
+            uart.printf("E");//debug END
+            compteur_uart =0;
         }
-        uart.printf("E");//debug END
+        else {
+        compteur_uart =compteur_uart+1;  
+        }
         
         for (int j=indexMin; j<indexMax; j++)
         {
-            if (pixel[j]>pixel[max_detect])
+            if (pixel1[j]>pixel1[max_detect])
             {
                 max_detect=j;
             }