const int arret = 22;
const int ouverture = 2;
const int aut = 4;
#define RELAIS 23
int etatarret = 0;
int etatouverture = 0;
int etataut = 0;
void setup() {
// put your setup code here, to run once:
pinMode(RELAIS,OUTPUT);
pinMode(etataut, INPUT_PULLUP);
pinMode(etatouverture, INPUT_PULLUP);
pinMode(etatarret, INPUT_PULLUP);
}
void loop()
{
// put your main code here, to run repeatedly:
etatouverture = digitalRead(ouverture);
etataut = digitalRead(etataut);
etatarret = digitalRead(etatarret);
if (etataut == HIGH)
{
digitalWrite(RELAIS, HIGH);
delay(5000);
digitalWrite(RELAIS, LOW);
}
if (etatouverture == HIGH)
{
digitalWrite(RELAIS, HIGH);
delay(5000);
digitalWrite(RELAIS, LOW);
}
if (etatarret == HIGH)
{
digitalWrite(RELAIS, HIGH);
delay(5000);
digitalWrite(RELAIS, LOW);
}
}