23 lines
459 B
C++
23 lines
459 B
C++
#ifndef LED_CONTROLLER_H
|
|
#define LED_CONTROLLER_H
|
|
|
|
#include <Arduino.h>
|
|
#include <Adafruit_MCP23X17.h>
|
|
|
|
class LEDController {
|
|
private:
|
|
Adafruit_MCP23X17* mcp1;
|
|
Adafruit_MCP23X17* mcp2;
|
|
bool ledStates[20];
|
|
|
|
public:
|
|
LEDController(Adafruit_MCP23X17* mcp1, Adafruit_MCP23X17* mcp2);
|
|
void init();
|
|
void setLED(uint8_t ledIndex, bool state);
|
|
void toggleLED(uint8_t ledIndex);
|
|
bool getLEDState(uint8_t ledIndex);
|
|
void updateHardware();
|
|
};
|
|
|
|
#endif
|