const int AAN = 0;
const int UIT = 1;
int huidigeToestand = AAN;
void setup() {
serialSetup();
ruitenwisserSetup();
}
void loop() {
switch (huidigeToestand) {
case AAN:
checkSerial();
beweegRuitenwisser();
break;
case UIT:
checkSerial();
break;
default:
break;
}
}
void wisselToestand() {
huidigeToestand = huidigeToestand == AAN ? UIT : AAN;
Serial.print("Ruitenwisser: ");
Serial.println(huidigeToestand == AAN ? " aan" : " uit");
}