#define Touch 10
int N = 0;
void setup() {
for (int i = 2; i <= 9; i++) pinMode(i, OUTPUT);
pinMode(Touch, INPUT);
}
void loop() {
while (!digitalRead(Touch));
switch (N) {
case 0:
for (int i = 2; i <= 9; i += 2) {
digitalWrite(i, HIGH); delay(200);
} for (int i = 2; i <= 9; i += 2) {
digitalWrite(i, LOW); delay(200);
} break;
case 1:
for (int t = 1; t <= 5; t++) {
for (int i = 2; i <= 9; i ++) digitalWrite(i, HIGH);
delay(400);
for (int i = 2; i <= 9; i += 2) digitalWrite(i, LOW);
delay(400);
}
for (int i = 3; i <= 9; i += 2) digitalWrite(i, LOW);
break;
case 3:
for (int t = 1; t <= 5; t++) {
for (int i = 2; i <= 9; i++) {
digitalWrite(i, HIGH); delay(50); digitalWrite(i, LOW);
}
}
for (int i = 3; i <= 9; i += 2) digitalWrite(i, LOW);
break;
//* case 4: ... ; break; // verzin zelf zoveel patronen als je wilt! */
}
N++;
if (N > 3) N = 0; // Achter > moet de hoogste waarde staan die in de case voorkomt.
delay(500);
}