POUVEZ-VOUS M'AIDER ?
(Sur 'ARDUINO UNO')
Sur le message d'erreur il y a écrit:
Compilation error: a founction-definition is not allowed here before '{' token
Voici le code:
#define LED 13
#define LED1 12
#define LED2 11
#define BUTTON 10
const int ledPin = 9;
int buttonState = 0;
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(10, INPUT);
}
void loop() {
digitalWrite (LED, HIGH);
Serial.println("LED R ALUMEE");
delay (5000);
digitalWrite (LED, LOW);
Serial.println("LED R ETEINTE");
digitalWrite (LED1, HIGH);
Serial.println("LED V ALUMEE");
delay (5000);
digitalWrite (LED1, LOW);
Serial.println("LED V ETEINTE");
digitalWrite (LED2, HIGH);
Serial.println("LED G ALUMEE");
delay (2000);
digitalWrite (LED2, LOW);
Serial.println("LED G ETEINTE");
if(buttonState == HIGH) {
void loop (){ // IL Y A ECRIT QUE IL Y A L'ERREUR ICI
digitalWrite(ledPin, HIGH);
}
}
}
MERCI d'avance !