remove variant

This commit is contained in:
2021-10-22 19:52:26 +02:00
parent 85528a619d
commit 54c326c784
15 changed files with 5 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ void c_chaingame::nextPattern(void)
void c_chaingame::runGame(void) void c_chaingame::runGame(void)
{ {
//check if we are idle
if (!patternFlag && !cheatButtonFlag) if (!patternFlag && !cheatButtonFlag)
{ {
if (buttonIsPressed(ledpattern[patternIndex])) if (buttonIsPressed(ledpattern[patternIndex]))
@@ -38,12 +39,14 @@ void c_chaingame::runGame(void)
} }
} }
// check if the actual pattern switch is off
if (!buttonIsPressed(ledpattern[patternIndex])) if (!buttonIsPressed(ledpattern[patternIndex]))
{ {
// pattern switch is open, turn off pattern LED // pattern switch is open, turn off pattern LED
turnOffLed(ledpattern[patternIndex]); turnOffLed(ledpattern[patternIndex]);
} }
// check if the game is in cheat mode and cheat switch is off
if (!buttonIsPressed(cheatbutton) && cheatButtonFlag) if (!buttonIsPressed(cheatbutton) && cheatButtonFlag)
{ {
// cheat switch is open, turn of cheat LED // cheat switch is open, turn of cheat LED
@@ -52,6 +55,7 @@ void c_chaingame::runGame(void)
cheatbutton = 0; cheatbutton = 0;
} }
// if all siwtches are off turn all LEDs off
if (!anybutton()) if (!anybutton())
{ {
//all switches are open, turn off all LEDs //all switches are open, turn off all LEDs

View File

@@ -1,4 +1,4 @@
#include "Arduino.h" #include "arduino.h"
#include "board.h" #include "board.h"
#include "buttons.h" #include "buttons.h"
#include "led.h" #include "led.h"