mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Added support for sk6812RGBW leds (ab)using the SPI interface. (#61)
right now it only uses RGB - white is set to zero
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "LedDeviceP9813.h"
|
||||
#include "LedDeviceWs2801.h"
|
||||
#include "LedDeviceWs2812SPI.h"
|
||||
#include "LedDeviceSk6812SPI.h"
|
||||
#include "LedDeviceAPA102.h"
|
||||
#endif
|
||||
|
||||
@@ -147,6 +148,16 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
|
||||
device = deviceWs2812SPI;
|
||||
}
|
||||
else if (type == "sk6812spi")
|
||||
{
|
||||
const std::string output = deviceConfig["output"].asString();
|
||||
const unsigned rate = deviceConfig.get("rate",2857143).asInt();
|
||||
|
||||
LedDeviceSk6812SPI* deviceSk6812SPI = new LedDeviceSk6812SPI(output, rate);
|
||||
deviceSk6812SPI->open();
|
||||
|
||||
device = deviceSk6812SPI;
|
||||
}
|
||||
#endif
|
||||
#ifdef ENABLE_TINKERFORGE
|
||||
else if (type=="tinkerforge")
|
||||
|
Reference in New Issue
Block a user