Bonjour a vous !
Je viens ici car j'ai une problème. Je dois commander un moteur pour un projet. Le but est qu'il tourne dans les deux sens, ce que j'ai réussis a faire en y intégrant des relais sur mon montage. Le bémol c'est que maintenant je dois y intégrer du bluetooth.
Voici un code qu'on ma proposé :
Mais le problème c'est que quand je téléverse, ça m'envoie comme erreur ceci :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 void __ardublockDigitalWrite(int pinNumber, boolean status) { digitalWrite(pinNumber, status); } void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); __ardublockDigitalWrite(2, LOW); __ardublockDigitalWrite(3, LOW); Serial.begin(9600); // Demarrer la liaison a 9600bauds } void loop() { if (Serial.available()) { // Attendre de recevoir des caracteres char c = Serial.read(); // Lire les caracteres recus et les stocker dans c if (c == '1') // Si c = 1 { __ardublockDigitalWrite(2, HIGH); __ardublockDigitalWrite(3, LOW);// Ouvrir le relais } else if (c == '2') // Si c = 0 { __ardublockDigitalWrite(2, LOW); __ardublockDigitalWrite(3, HIGH); // Fermer le relais } else if (c == '0') // Si c = 0 { __ardublockDigitalWrite(2, LOW); __ardublockDigitalWrite(3, LOW); // Ouvrir le relais } } }
Pouvez-vous m'aider svp ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x59 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x59
Partager