mirror of
https://github.com/Lemonochrme/clover.git
synced 2025-06-08 08:40:50 +02:00
22 lines
No EOL
504 B
C++
22 lines
No EOL
504 B
C++
#include "LedComponent.hpp"
|
|
|
|
LedComponent::LedComponent(byte pin, byte pin_clock, uint8_t led_number)
|
|
: _pin(pin), _pinClock(pin_clock), _ledNumber(led_number), _led(nullptr)
|
|
{}
|
|
|
|
LedComponent::~LedComponent()
|
|
{
|
|
delete _led;
|
|
}
|
|
|
|
void LedComponent::setup()
|
|
{
|
|
_led = new ChainableLED(_pinClock,_pin,_ledNumber);
|
|
}
|
|
|
|
void LedComponent::setColor(uint8_t led_number, Color color)
|
|
{
|
|
if(led_number >= _ledNumber)
|
|
return;
|
|
_led->setColorRGB(led_number,color.red,color.green,color.blue);
|
|
} |