robot final c est la fin

Dependencies:   AFFICHAGE Bluetooth_HC05_LE_TRAME Deplacement LED_Debug PATTERN LED SRF05 m3pi mbed ROBOT

Files at this revision

API Documentation at this revision

Comitter:
aure
Date:
Thu Mar 23 12:49:54 2017 +0000
Parent:
0:238a3e4fa7bc
Commit message:
gndjghiuch

Changed in this revision

Bluetooth_HC05_LE_TRAME.lib Show annotated file Show diff for this revision Revisions of this file
Deplacement.lib Show annotated file Show diff for this revision Revisions of this file
LED.lib Show annotated file Show diff for this revision Revisions of this file
PATTERN.lib Show annotated file Show diff for this revision Revisions of this file
ROBOT.lib Show annotated file Show diff for this revision Revisions of this file
ROBOT2.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/Bluetooth_HC05_LE_TRAME.lib	Fri Mar 17 18:17:06 2017 +0000
+++ b/Bluetooth_HC05_LE_TRAME.lib	Thu Mar 23 12:49:54 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/Projet-robot1/code/Bluetooth_HC05_LE_TRAME/#7cc085e87bb0
+https://developer.mbed.org/teams/Projet-robot1/code/Bluetooth_HC05_LE_TRAME/#f597583e8b55
--- a/Deplacement.lib	Fri Mar 17 18:17:06 2017 +0000
+++ b/Deplacement.lib	Thu Mar 23 12:49:54 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Projet-robot1/code/Deplacement/#00043b0d1e5e
+http://developer.mbed.org/teams/Projet-robot1/code/Deplacement/#5459169b6a52
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LED.lib	Thu Mar 23 12:49:54 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Projet-robot1/code/LED/#ca5c598be185
--- a/PATTERN.lib	Fri Mar 17 18:17:06 2017 +0000
+++ b/PATTERN.lib	Thu Mar 23 12:49:54 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Projet-robot1/code/PATTERN/#42a271a32851
+http://developer.mbed.org/teams/Projet-robot1/code/PATTERN/#601c2fa986bf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ROBOT.lib	Thu Mar 23 12:49:54 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Projet-robot1/code/ROBOT/#d88127a08e44
--- a/ROBOT2.lib	Fri Mar 17 18:17:06 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/teams/Projet-robot1/code/ROBOT2/#54e0d8e5b028
--- a/main.cpp	Fri Mar 17 18:17:06 2017 +0000
+++ b/main.cpp	Thu Mar 23 12:49:54 2017 +0000
@@ -4,6 +4,7 @@
 #include "Bluetooth_HC05_LE_TRAME.h"
 
  
+#define DEBUG 1 //entre ne mode debug                            oui=1 non =0
  
  
  
@@ -14,21 +15,24 @@
 
  
 int main() {
-    
+ 
+   
     Bluetooth_HC05_LE_TRAME blu;
     Robot robot;
     LED_Debug d;
     
     
-    d.add();
-    pc.printf("DEBUT\r\n");
+    if(DEBUG==1)
+    {
+    pc.printf("DEBUT DEBUG\r\n");
+    }
    
-   pc.printf("CONFIGURATION BAUDS OK\r\n");
+ 
 
-  blu.envoyer("bonjour\r\n");
-   d.add();
+  blu.envoyer("OKCOM\r\n");
+
    
-  
+ 
     
 ////////////////////////////////////////////
 
@@ -38,91 +42,81 @@
    
    int copie;
    int i=0;
-   
+if(DEBUG==1)   //////////////////////////////////////////////DEBUG==1/////////////////
+ {   
    while(1)
    {
-   
-    if (blu.donneesRecue()==1) {
-        d.resetCpt();
-         
-         pc.printf(" 0k1\r\n");
-         
-        
-       
-   
-                 
-                 int compteur=0;
-                 char buffer[100];
-                 ///////////////////////////////////////////////OK rematrre apres
-             while(blu.donneesRecue()==1)
-                 {
-                     buffer[0]=blu.recevoir(1);
-                     pc.printf("recevoir=     %c\r\n",buffer[0]);
-                     
-                    
-                    // buffer[compteur]=toto;
-                    //  compteur++;
-                      
-                      
-                     }
-                     pc.printf(" ok2\r\n");
-                    // blu.resetBuffer();
-                 ////////////////////////////////////////////    
-                     pc.printf(" ok3\r\n");
-                    // char*recu=blu.recevoir(1);
-                     //char *recu=&buffer[0];
-                     /////////////////////////////////////////// test
-                     
-                    
-                     
-                     ///////////////////////////////////////
-                     
         
-            
-             pc.printf(" ok4\r\n");
-             pc.printf("envoi =    %c ",buffer[0]);
-             pc.printf(" ok5\r\n");
-             blu.envoyer("hello\r\n");
-             pc.printf(" ok6\r\n");
-             blu.envoyer("salut je suis un robot\r\n");
-             pc.printf(" ok7\r\n");
-            
-       
-              
-           
-              //////////////////////////////////////////
-            
-             pc.printf(" ok8\r\n");
-             ////////////////////////////////////////////////
-             pc.printf("ROBOT ACTION\r\n");
-             d.add();
-           
-            
-            
-           // robot.action(recu[0]);
-           pc.printf("%c \r\n",buffer[0]);
-           
-             pc.printf(" ok9\r\n");
-             
-             robot.action(buffer[0]);
-             
-             d.add();
-             pc.printf("ROBOT ACTION FIN\r\n");
-             pc.printf(" ok10\r\n");
-             ////////////////////////////////////////////////////
-             
+        if (blu.donneesRecue()==1)
+        {   
+        pc.printf("1\r\n");
+                  
+                                 int compteur=0;
+                             while(blu.donneesRecue()==1)
+                                 {
+                                  pc.printf("11\r\n");
+                                  blu.recevoir();
+                                  pc.printf("12\r\n");
+                                     }
+                                     pc.printf("13\r\n");
+                                     char*recu=blu.getBuf();
+                                     for(i=0;i<blu.getLongueurTrame();i++)
+                                     {
+                                         printf("recu%d = %c\r\n",i,recu[i]);
+                                    }
+                                     pc.printf("14\r\n");
+                    // blu.envoyer(strcat(recu,"\r\n"));
+                     pc.printf("15\r\n");
+                             robot.action(recu[2],recu[0],recu[1]);
+                             pc.printf("16\r\n");
+                      blu.envoyer("ok\r\n");  
+                      pc.printf("17\r\n");
+                      
+                 blu.resetBuffer();
+                 pc.printf("18\r\n");
+                //  wait(2);
+                  pc.printf("19\r\n");
           
-    
-    ///////////////////////////////////////
-    
-    blu.resetBuffer();
-    pc.printf(" ok11\r\n");
-    ////////////////////////////////
-    
-    wait(2);
-     pc.printf(" ok12\r\n");
+         }
+   
+     }
+    }
+
+else    //DEBUG==0////////////////////////////////////////////////////////////////////
+{
+     while(1)
+   {
         
-   }
+        if (blu.donneesRecue()==1)
+        {   
+        pc.printf("1\r\n");
+                  
+                                 int compteur=0;
+                             while(blu.donneesRecue()==1)
+                                 {
+                                  pc.printf("11\r\n");
+                                  blu.recevoir();
+                                  pc.printf("12\r\n");
+                                     }
+                                     pc.printf("13\r\n");
+                                     char*recu=blu.getBuf();
+                                     pc.printf("14\r\n");
+                    // blu.envoyer(strcat(recu,"\r\n"));
+                     pc.printf("15\r\n");
+                             robot.action(recu[2],recu[0],recu[1]);
+                             pc.printf("16\r\n");
+                      blu.envoyer("ok\r\n");  
+                      pc.printf("17\r\n");
+                      
+                 blu.resetBuffer();
+                 pc.printf("18\r\n");
+                //  wait(2);
+                  pc.printf("19\r\n");
+          
+         }
    
+     }
 }
+/////////////////////////////////////////////////////////////////////////////////////////////////////
 }
+
--- a/mbed.bld	Fri Mar 17 18:17:06 2017 +0000
+++ b/mbed.bld	Thu Mar 23 12:49:54 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/ef9c61f8c49f
\ No newline at end of file
+https://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb
\ No newline at end of file