add rgbled.cpp .h
This commit is contained in:
32
rgbled.h
Normal file
32
rgbled.h
Normal file
@ -0,0 +1,32 @@
|
||||
#include "pwm.h"
|
||||
|
||||
class RgbLed
|
||||
{
|
||||
private:
|
||||
Pwm8b* _pwmA;
|
||||
Pwm8b* _pwmB;
|
||||
|
||||
uint8_t _pattern = 0;
|
||||
|
||||
uint16_t _counter = 0;
|
||||
bool _stroke = false;
|
||||
|
||||
|
||||
void patternStep();
|
||||
|
||||
public:
|
||||
RgbLed( Pwm8b* pwmA, Pwm8b* pwmB );
|
||||
|
||||
void setSolidColor( const uint8_t r, const uint8_t g, const uint8_t b);
|
||||
void setPattern(const uint8_t id);
|
||||
void setPreset( const uint8_t preset);
|
||||
|
||||
void on();
|
||||
void off();
|
||||
|
||||
void logic();
|
||||
uint8_t getR();
|
||||
uint8_t getB();
|
||||
uint8_t getG();
|
||||
|
||||
};
|
Reference in New Issue
Block a user