top of page
Bouton
void setup()
{
pinMode(12, OUTPUT);
pinMode(2, INPUT);
}
void loop() {
int buttonState=digitalRead(2);
if(buttonState==HIGH)
{
if(digitalRead(12)==HIGH)
{
digitalWrite(12, LOW);
delay(150);
}
else if(digitalRead(12)==LOW)
{
digitalWrite(12, HIGH);
delay(150);
}
}
}
Explication: Quand on appuie la led s'allume puis quand on r'appuie la led s'éteint.
bottom of page