48 lines
917 B
C++
48 lines
917 B
C++
#pragma once
|
|
|
|
// System Inlcudes
|
|
#include <Arduino.h>
|
|
#include <Adafruit_NeoPixel.h>
|
|
|
|
#define RED 0x00FF00
|
|
#define GREEN 0xFF0000
|
|
#define BLUE 0x0000FF
|
|
#define WHITE 0xFFFFFF
|
|
#define YELLOW 0xFFFF00
|
|
#define CYAN 0xFF00FF
|
|
#define MAGENTA 0x00FFFF
|
|
#define ORANGE 0xA5FF00
|
|
#define PURPLE 0x008080
|
|
#define PINK 0x69FFB4
|
|
#define LIME 0xCD3232
|
|
#define SKY_BLUE 0xCE87EB
|
|
#define GOLD 0xD7FF00
|
|
#define TURQUOISE 0xE040D0
|
|
#define INDIGO 0x004B82
|
|
#define GRAY 0x808080
|
|
|
|
class RGBled
|
|
{
|
|
public:
|
|
enum LedStatus
|
|
{
|
|
OK = GREEN,
|
|
ERROR = RED,
|
|
INIT = YELLOW,
|
|
DATA_A = CYAN,
|
|
DATA_B = MAGENTA,
|
|
DATA_ALL = ORANGE,
|
|
IDLE = GRAY
|
|
};
|
|
|
|
public:
|
|
RGBled(const uint8_t pin = 48, const uint8_t num = 1);
|
|
~RGBled();
|
|
|
|
void setStatus(const LedStatus s);
|
|
const LedStatus getSatus(void);
|
|
|
|
private:
|
|
Adafruit_NeoPixel m_led;
|
|
LedStatus m_status = LedStatus::IDLE;
|
|
}; |