Added MCP23S17 support as well as changed some pins and added more de-bouncing for the buttons.
This commit is contained in:
@ -4,13 +4,16 @@
|
||||
#include "config.h"
|
||||
#include "player.h"
|
||||
#include <MFRC522.h>
|
||||
#include <MCP23S17/MCP23S17.h>
|
||||
|
||||
class Controller {
|
||||
private:
|
||||
MFRC522* _rfid;
|
||||
MCP* _mcp;
|
||||
bool _rfid_enabled = true;
|
||||
void _check_rfid();
|
||||
void _check_serial();
|
||||
void _check_buttons();
|
||||
uint32_t _get_rfid_card_uid();
|
||||
uint32_t _last_rfid_card_uid = 0;
|
||||
Player* _player;
|
||||
@ -19,7 +22,9 @@ private:
|
||||
void _execute_serial_command(String cmd);
|
||||
void _execute_command_ls(String path);
|
||||
void _execute_command_help();
|
||||
unsigned long _button_last_pressed_at[NUM_BUTTONS];
|
||||
bool _check_button(uint8_t btn);
|
||||
public:
|
||||
Controller(Player* p);
|
||||
Controller(Player* p, MCP* m);
|
||||
void loop();
|
||||
};
|
||||
|
Reference in New Issue
Block a user