Changed to JC_button lib

This commit is contained in:
willem oldemans
2020-11-19 08:27:52 +01:00
parent 8c9176ccbe
commit d184f1785c
8 changed files with 135 additions and 167 deletions

View File

@@ -1,10 +1,10 @@
#include "chainGame.h"
#include "Arduino.h"
#include "buttons.h"
#include "JC_Button.h"
extern buttons button1;
extern buttons button2;
extern buttons button3;
extern ToggleButton button4;
extern ToggleButton button5;
extern ToggleButton button6;
uint8_t patternIndex = 0;
@@ -31,9 +31,9 @@ void nextPattern(void)
}
}
void HandleChainGame(void)
void HandleChainGame( void )
{
if (button1.state())
if ((button4.isPressed()) | (button6.isPressed()))
{
if (!patternFlag)
{
@@ -51,7 +51,7 @@ void HandleChainGame(void)
}
}
if (button2.state())
if (button5.isPressed())
{
if (!patternFlag)
{
@@ -69,7 +69,7 @@ void HandleChainGame(void)
}
}
if (button1.state() | button2.state())
if ((button4.isPressed()) | (button5.isPressed()) | (button6.isPressed()))
{
//write pattern to the LEDs
digitalWrite(LED1, ledpattern[patternIndex][0]);