7Robot_Freescale / Mbed 2 deprecated freescal_cup_k22f

Dependencies:   mbed freescal_cup_k22f

Dependents:   freescal_cup_k22f

Revision:
27:d1da489fc79a
Parent:
26:a836e62e0c98
Child:
28:c9d882501013
--- a/source/main.cpp	Wed Jan 21 16:54:53 2015 +0000
+++ b/source/main.cpp	Wed Jan 21 17:34:38 2015 +0000
@@ -6,11 +6,13 @@
 #include "Camera.h"
 #include "Servo.h"
 
+
 //Differents objet/variable global
 
+//Xbee
+Serial uart(PTD3, PTD2);
+
 //test de commit
-
-Serial uart(PTD3, PTD2); //xbee
 //Serial uart(USBTX, USBRX); //port série usb ACM0
 
 AnalogIn pot1(PTC1);
@@ -18,44 +20,46 @@
 int main() {
  // Initialisation
  
-
-    int compteur_uart=0;
-    int indice_pixel;
     //float Kp_servo = 0;
-    uart.baud(115200); 
     init_led();
     init_camera();
    
+    int compteur_uart=0;
+    
     // Init UART baudrate
+    uart.baud(115200); 
 
          
     // Lancement boucle
     while(1){
         
-        if (flag_new_image==1){
-          /*  if (compteur_uart ==15) // on envoit une trame toute les 50 acquisitions de cameras
+        if (flag_new_image==1)
+        {
+            if (compteur_uart ==20) // on envoit une trame toute les 50 acquisitions de cameras
             {  
                 uart.printf("S1");//debug START
-                for (indice_pixel=0; indice_pixel<128; indice_pixel++)   
+                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 (indice_pixel=0; indice_pixel<128; indice_pixel++)   
+                for (int indice_pixel=0; indice_pixel<128; indice_pixel++)   
                 {
                     uart.printf("%d,",pixel2[indice_pixel]);
                 }
                 uart.printf("E");//debug END
                 compteur_uart =0;
             }
-            else {
+            else 
+            {
                 compteur_uart =compteur_uart+1;  
-            }*/
-            uart.printf("0,%d,%d\n\r",max_detect1,max_detect2);
-            flag_new_image=0;
+            }
         }
+        // uart.printf("0,%d,%d\n\r",max_detect1,max_detect2);
+        flag_new_image=0;
+
     }
 }