Commit 58056f07e824bf587a7c6fe0203c53a34fec3607
1 parent
cf4b546b
Mise à jour du programme à la dernière version
Showing
1 changed file
with
3 additions
and
24 deletions
Show diff stats
Programme_arduino_robot
... | ... | @@ -14,6 +14,7 @@ int ECHO = A0; |
14 | 14 | long cm; |
15 | 15 | long lect_echo; |
16 | 16 | int envoi=0; |
17 | +char inByte='a'; | |
17 | 18 | |
18 | 19 | void setup() { |
19 | 20 | Serial.begin(9600); |
... | ... | @@ -25,7 +26,6 @@ pinMode(ECHO,INPUT); |
25 | 26 | |
26 | 27 | void loop() { |
27 | 28 | String msg; |
28 | - char inByte='a'; | |
29 | 29 | int i = 0; |
30 | 30 | int nb_if = 0; |
31 | 31 | char id_sauv; |
... | ... | @@ -36,40 +36,19 @@ void loop() { |
36 | 36 | int capteur; |
37 | 37 | //boucle dans une boucle gérée |
38 | 38 | |
39 | - /* soft2.listen(); | |
39 | + soft2.listen(); | |
40 | 40 | while(soft2.available()>0 && inByte !='\n'){ |
41 | 41 | inByte=soft2.read(); |
42 | 42 | msg+=inByte; |
43 | 43 | delay(10); |
44 | 44 | i++; |
45 | 45 | envoi=1; |
46 | - }*/ | |
47 | - if(envoi==0){ | |
48 | - Serial.println("etape 0"); | |
49 | - delay(20000); | |
50 | - msg += (char)0x10; | |
51 | - msg += (char)0x61; | |
52 | - msg += (char)0x0F; | |
53 | - msg += (char)0x20; | |
54 | - msg += (char)0x10; | |
55 | - msg += (char)0x70; | |
56 | - msg += (char)0x10; | |
57 | - msg += (char)0x61; | |
58 | - msg += (char)0x0F; | |
59 | - msg += (char)0x40; | |
60 | - msg += (char)0x04; | |
61 | - msg += (char)0x30; | |
62 | - msg += (char)0x50; | |
63 | - msg += (char)0x70; | |
64 | - i = 14; | |
65 | - envoi=1; | |
66 | - Serial.println("etape 1"); | |
67 | 46 | } |
47 | + | |
68 | 48 | //++a01z++a++z test if |
69 | 49 | //++B 1Q+z test while (executé 32 fois) |
70 | 50 | //++B 1B +Q1Q+z test while dans un while |
71 | 51 | if(envoi==1){ |
72 | - Serial.println("étape 2"); | |
73 | 52 | for(int k=0;k<i;k++){ |
74 | 53 | if((msg.charAt(k) & 0xF0) ==0x10){ |
75 | 54 | Serial.print("tout droit\n\r"); | ... | ... |