bonjour en fait c’est un circuit avec arduino pour les feu tricolore et je l’ai programmer voici la programmation
define DELAY1 10000
define DELAY2 2000
define DELAY3 3000
int ledPinRedDrive = 7;
int ledPinYellowDrive = 6;
int ledPinGreenDrive = 5;
int ledPinRedWalk = 3;
int ledPinGreenWalk = 2;
int buttonPinLight = 8;
int buttonLightValue = LOW;
void setup(){
pinMode(ledPinRedDrive, OUTPUT);
pinMode(ledPinYellowDrive, OUTPUT);
pinMode(ledPinGreenDrive,OUTPUT);
pinMode(ledPinRedWalk, OUTPUT);
pinMode(ledPinGreenWalk,OUTPUT);
pinMode(buttonPinLight, INPUT);
digitalWrite(ledPinGreenDrive, HIGH);
digitalWrite(ledPinRedWalk, HIGH);
}
void loop(){
buttonLightValue = digitalRead (buttonPinLight);
if(buttonLightValue ==HIGH)
lightChange();
}
void lightChange(){
digitalWrite (ledPinGreenDrive, LOW);
digitalWrite (ledPinYellowDrive, HIGH); delay (DELAY3);
digitalWrite (ledPinYellowDrive, LOW);
digitalWrite (ledPinRedDrive, HIGH); delay (DELAY1);
digitalWrite (ledPinRedWalk, LOW);
digitalWrite (ledPinGreenWalk, HIGH); delay(DELAY2);
digitalWrite (ledPinGreenWalk, LOW);
digitalWrite (ledPinRedWalk, HIGH); delay(DELAY1);
digitalWrite (ledPinYellowDrive, HIGH);delay(DELAY2);
digitalWrite (ledPinRedDrive, LOW);
digitalWrite (ledPinYellowDrive,LOW);
digitalWrite (ledPinGreenDrive,HIGH);
}
et mon logiciel arduino me dit que tout est bon.
le circuit est bon mais les led ne fonctionne pas
merci