/* Arduino Spiel Autor: Johannes Tümler Letzte Änderung: 20.05.2022 Zweck: Beleg 3 Hilfscode für einen leichteren Einstieg */ enum Menu{ MENU0, MENU1, MENU2, MENU3, MENU4, MENU5, MENU6, MENU7 }; const int red = 13, blue = 12, green = 11; int num=0;int num1=0; int currentOrder = 0; Menu menu = MENU0; const int startPin = 1; const int endPin = 9; const int maxAmount = 20; int numList[maxAmount]; void setup() { pinMode(red, OUTPUT); pinMode(green, OUTPUT); pinMode(blue, OUTPUT); pinMode(10, INPUT_PULLUP); pinMode(9, INPUT_PULLUP); pinMode(8, INPUT_PULLUP); pinMode(7, INPUT_PULLUP); pinMode(6, INPUT_PULLUP); pinMode(5, INPUT_PULLUP); pinMode(4, INPUT_PULLUP); pinMode(3, INPUT_PULLUP); pinMode(2, INPUT_PULLUP); pinMode(1, INPUT_PULLUP); // Serial.begin(9600); resetAllPins(); } void resetAllPins() { digitalWrite(red, LOW); digitalWrite(green, LOW); digitalWrite(blue, LOW); digitalWrite(1, HIGH); digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(4, HIGH); digitalWrite(5, HIGH); digitalWrite(6, HIGH); digitalWrite(7, HIGH); digitalWrite(8, HIGH); digitalWrite(9, HIGH); digitalWrite(10, HIGH); } void blink(const int *pin) { digitalWrite(*pin, HIGH); delay(500); digitalWrite(*pin, LOW); delay(500); } void loop() { switch(menu){ case MENU0: // Serial.print("Menu 0\n"); currentOrder = 0; for (int i=0; i