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:
penfold42
2016-06-28 06:43:35 +10:00
committed by brindosch
parent 2fff9ae4fc
commit 96037da1cf
5 changed files with 123 additions and 4 deletions

View File

@@ -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")