29 lines
528 B
C++
29 lines
528 B
C++
#include <led.h>
|
|
|
|
RGBled::RGBled(const uint8_t pin, const uint8_t num)
|
|
{
|
|
m_led = Adafruit_NeoPixel(num, pin, NEO_GRB + NEO_KHZ800);
|
|
m_led.begin();
|
|
m_led.setPixelColor(0, RED);
|
|
m_led.show();
|
|
}
|
|
|
|
RGBled::~RGBled()
|
|
{
|
|
m_led.clear();
|
|
}
|
|
|
|
void RGBled::setStatus(const LedStatus s)
|
|
{
|
|
if (m_status == s) return;
|
|
m_status = s;
|
|
RGB_BUILTIN_LED_COLOR_ORDER
|
|
m_led.setPixelColor(0, s);
|
|
m_led.setBrightness(16);
|
|
m_led.show();
|
|
}
|
|
|
|
const RGBled::LedStatus RGBled::getSatus(void)
|
|
{
|
|
return m_status;
|
|
} |