manufacturing
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <vector>
|
||||
#ifndef UNIT_TEST
|
||||
#include "JC_Button.h"
|
||||
#endif
|
||||
#include "JC_Button.h"
|
||||
#include "board.h"
|
||||
#include "led.h"
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void HandleChainGame(void)
|
||||
else if (anybutton())
|
||||
{
|
||||
// if any other button is pressed, clear cheat button
|
||||
cheatbutton = 0;
|
||||
//cheatbutton = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ void handleDetectLed(void)
|
||||
void initDetectLed(void)
|
||||
{
|
||||
ledlist_ptr = getledlist();
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
analogReadResolution(10);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
18
src/game.h
Normal file
18
src/game.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef GAMEH
|
||||
#define GAMEH
|
||||
|
||||
class c_game
|
||||
{
|
||||
|
||||
protected:
|
||||
bool _status;
|
||||
|
||||
public:
|
||||
c_game(void): _status(false) {};
|
||||
|
||||
void runGame(void);
|
||||
void initGame(void);
|
||||
bool getStatus(void) { return _status;}
|
||||
};
|
||||
|
||||
#endif //GAMEH
|
||||
@@ -175,8 +175,10 @@ bool c_leds::verifyLed(uint16_t index)
|
||||
|
||||
void c_ledport::begin(void)
|
||||
{
|
||||
#ifndef UNIT_TEST
|
||||
pinMode(_pin, OUTPUT);
|
||||
pinMode(_analogPin, INPUT_ANALOG);
|
||||
#endif
|
||||
turnOff();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@ public:
|
||||
|
||||
void writeLed(bool state);
|
||||
|
||||
bool getLedState( void ) {return _state; }
|
||||
|
||||
uint16_t ledRead(void);
|
||||
|
||||
uint16_t getIndex(void) { return _index; }
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef UNIT_TEST
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
|
||||
#include "board.h"
|
||||
#include "chainGame.h"
|
||||
#include "detectled.h"
|
||||
@@ -192,3 +191,5 @@ void loop()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,18 @@
|
||||
#include "simpleled.h"
|
||||
|
||||
|
||||
void c_simpleLed::runGame(void)
|
||||
{
|
||||
handleSimpleLed();
|
||||
}
|
||||
|
||||
void c_simpleLed::initGame(void)
|
||||
{
|
||||
initSimpleLed();
|
||||
_status = true;
|
||||
}
|
||||
|
||||
|
||||
extern std::vector<c_button *> buttonlist;
|
||||
|
||||
bool status = false;
|
||||
@@ -23,4 +35,9 @@ void handleSimpleLed(void)
|
||||
turnOffLed(button->getIndex());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool getStatusSimpleLed( void )
|
||||
{
|
||||
return status;
|
||||
}
|
||||
@@ -4,9 +4,18 @@
|
||||
#include "led.h"
|
||||
#include "buttons.h"
|
||||
#include "vector"
|
||||
#include "game.h"
|
||||
|
||||
class c_simpleLed : public c_game
|
||||
{
|
||||
void runGame(void);
|
||||
void initGame(void);
|
||||
};
|
||||
|
||||
|
||||
void initSimpleLed( void );
|
||||
void handleSimpleLed( void );
|
||||
bool getStatusSimpleLed( void );
|
||||
|
||||
|
||||
#endif //SIMPLELEDH
|
||||
Reference in New Issue
Block a user