Changed to JC_button lib
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user