#include SoftwareSerial soft2(8,9); int pwma = 10; int pwmb = 11; int ain1 = 7; int ain2 = 6; int bin1 = 5; int bin2 = 4; int stby = 3; int TRIG = A1; int ECHO = A0; long cm; long lect_echo; int envoi=0; void setup() { Serial.begin(9600); soft2.begin(38400); pinMode(TRIG,OUTPUT); digitalWrite(TRIG, LOW); pinMode(ECHO,INPUT); } void loop() { String msg; char inByte='a'; int i = 0; int nb_if = 0; char id_sauv; int test_if; int nb_boucles[6]; char id_boucles[6]; int boucle_rec = 0; int capteur; //boucle dans une boucle gérée /* 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 cm){ nb_if++; test_if=nb_if; id_sauv = msg.charAt(k+1); while(((msg.charAt(k)) & 0xF0) != 0x70 && k