Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed freescal_cup_k22f
Diff: source/main.cpp
- Revision:
- 29:e7f37f801c93
- Parent:
- 28:c9d882501013
--- a/source/main.cpp	Wed Jan 21 18:19:56 2015 +0000
+++ b/source/main.cpp	Tue Jan 27 11:53:40 2015 +0000
@@ -6,6 +6,7 @@
 #include "Camera.h"
 #include "Servo.h"
 
+#define debug_uart 1
 
 //Differents objet/variable global
 
@@ -15,11 +16,11 @@
 //test de commit
 //Serial uart(USBTX, USBRX); //port série usb ACM0
 
-AnalogIn pot1(PTC1);
+
 
 int main() {
  // Initialisation
- 
+    wait(2);
     //float Kp_servo = 0;
     init_led();
     init_camera();
@@ -28,41 +29,46 @@
     
     // Init UART baudrate
     uart.baud(115200); 
-
+    
          
     // Lancement boucle
     while(1){
         
-        if (flag_new_image==1)
-        {
-           // uart.printf("0,%d,%d\n\r",max_detect1,max_detect2);
-            if (compteur_uart ==20) // on envoit une trame toute les 50 acquisitions de cameras
-            {  
-                uart.printf("S3");//debug START
-                uart.printf("%d,%d,%d,%lf,",max_detect1,max_detect2,0,ordre_servo);
-                uart.printf("E");//debug END
-                uart.printf("S1");//debug START
-                for (int indice_pixel=0; indice_pixel<128; indice_pixel++)   
-                {
-                    uart.printf("%d,",pixel1[indice_pixel]);
+/***************** DEBUG UART *********************/
+        if(debug_uart == 1) {
+            if (flag_new_image==1)
+            {
+               // uart.printf("0,%d,%d\n\r",max_detect1,max_detect2);
+                if (compteur_uart ==20) // on envoit une trame toute les 50 acquisitions de cameras
+                {  
+                    uart.printf("S3");//debug START
+                    uart.printf("%d,%d,%d,%lf,",max_detect1,max_detect2,0,ordre_servo);
+                    uart.printf("E");//debug END
+                    uart.printf("S1");//debug START
+                    for (int indice_pixel=0; indice_pixel<128; indice_pixel++)   
+                    {
+                        uart.printf("%f,",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("%f,",pixel2[indice_pixel]);
+                    }
+                    uart.printf("E");//debug END
+                    compteur_uart =0;
                 }
-                uart.printf("E");//debug END
-                        
-                uart.printf("S2");//debug START
-                for (int indice_pixel=0; indice_pixel<128; indice_pixel++)   
+                else 
                 {
-                    uart.printf("%d,",pixel2[indice_pixel]);
+                    compteur_uart =compteur_uart+1;  
                 }
-                uart.printf("E");//debug END
-                compteur_uart =0;
             }
-            else 
-            {
-                compteur_uart =compteur_uart+1;  
-            }
+            flag_new_image=0;
         }
-       
-        flag_new_image=0;
+
+/***************** Code Main ici *********************/
+
 
     }
 }