Commit 9f3bbb3b authored by Jérôme Abel's avatar Jérôme Abel
Browse files

code arduino

parent 531d720b
int relayPins [] = {2,3,4};
int NB = 3;
int index = 0;
int TIME = 5000;
void setup() {
for (int i = 0; i < NB; i++) {
pinMode(relayPins[i], OUTPUT);
}
pinMode(12,OUTPUT);
digitalWrite(12, HIGH);
}
void loop() {
TIME = random (5000, 10000);
for (int i = 0; i < NB; i++) {
digitalWrite(relayPins[i], HIGH);
delay(TIME);
digitalWrite(relayPins[i], LOW);
delay(TIME);
}
for (int i = 0; i < NB; i++) {
digitalWrite(relayPins[i], HIGH);
delay(TIME);
digitalWrite(relayPins[i], LOW);
delay(TIME);
}
for (int i = 0; i < NB; i++) {
digitalWrite(relayPins[i], HIGH);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment