first commit
This commit is contained in:
31
include/drivers/LEDController.h
Normal file
31
include/drivers/LEDController.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef LED_CONTROLLER_H
|
||||
#define LED_CONTROLLER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class LEDController {
|
||||
private:
|
||||
const int _ledPin;
|
||||
bool _state;
|
||||
bool _isBlinking;
|
||||
unsigned long _previousMillis;
|
||||
unsigned long _blinkInterval;
|
||||
unsigned long _blinkCount;
|
||||
|
||||
public:
|
||||
LEDController(int ledPin);
|
||||
LEDController(int ledPin, bool state);
|
||||
void turnOn();
|
||||
void turnOff();
|
||||
void toggle();
|
||||
bool getState() const;
|
||||
void blink(bool enable);
|
||||
bool isBlinkingEnabled() const;
|
||||
void interval(unsigned long interval);
|
||||
unsigned long getBlinkInterval() const;
|
||||
unsigned long getBlinkCount() const;
|
||||
void tick();
|
||||
void set(bool value);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user