diff --git a/Programme_arduino_robot b/Programme_arduino_robot index 3396159..752db87 100644 --- a/Programme_arduino_robot +++ b/Programme_arduino_robot @@ -14,6 +14,7 @@ int ECHO = A0; long cm; long lect_echo; int envoi=0; +char inByte='a'; void setup() { Serial.begin(9600); @@ -25,7 +26,6 @@ pinMode(ECHO,INPUT); void loop() { String msg; - char inByte='a'; int i = 0; int nb_if = 0; char id_sauv; @@ -36,40 +36,19 @@ void loop() { int capteur; //boucle dans une boucle gérée - /* soft2.listen(); + soft2.listen(); while(soft2.available()>0 && inByte !='\n'){ inByte=soft2.read(); msg+=inByte; delay(10); i++; envoi=1; - }*/ - if(envoi==0){ - Serial.println("etape 0"); - delay(20000); - msg += (char)0x10; - msg += (char)0x61; - msg += (char)0x0F; - msg += (char)0x20; - msg += (char)0x10; - msg += (char)0x70; - msg += (char)0x10; - msg += (char)0x61; - msg += (char)0x0F; - msg += (char)0x40; - msg += (char)0x04; - msg += (char)0x30; - msg += (char)0x50; - msg += (char)0x70; - i = 14; - envoi=1; - Serial.println("etape 1"); } + //++a01z++a++z test if //++B 1Q+z test while (executé 32 fois) //++B 1B +Q1Q+z test while dans un while if(envoi==1){ - Serial.println("étape 2"); for(int k=0;k