Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit 2f51f5f

Browse files
committed
Merge pull request #165 from kammerjaeger/master
Support for WS281b
2 parents fef34df + e716fa3 commit 2f51f5f

File tree

4 files changed

+1139
-0
lines changed

4 files changed

+1139
-0
lines changed

libsrc/leddevice/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ if(ENABLE_SPIDEV)
6868
)
6969
endif(ENABLE_SPIDEV)
7070

71+
SET(Leddevice_HEADERS
72+
${Leddevice_HEADERS}
73+
${CURRENT_SOURCE_DIR}/LedDeviceWS2812b.h
74+
)
75+
SET(Leddevice_SOURCES
76+
${Leddevice_SOURCES}
77+
${CURRENT_SOURCE_DIR}/LedDeviceWS2812b.cpp
78+
)
79+
7180
if(ENABLE_TINKERFORGE)
7281
SET(Leddevice_HEADERS
7382
${Leddevice_HEADERS}

libsrc/leddevice/LedDeviceFactory.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "LedDevicePhilipsHue.h"
3232
#include "LedDeviceTpm2.h"
3333

34+
#include "LedDeviceWS2812b.h"
35+
3436
LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
3537
{
3638
std::cout << "Device configuration: " << deviceConfig << std::endl;
@@ -181,6 +183,10 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
181183
LedDeviceTpm2* deviceTpm2 = new LedDeviceTpm2(output, rate);
182184
deviceTpm2->open();
183185
device = deviceTpm2;
186+
}else if (type == "ws2812b")
187+
{
188+
LedDeviceWS2812b * ledDeviceWS2812b = new LedDeviceWS2812b();
189+
device = ledDeviceWS2812b;
184190
}
185191
else
186192
{

0 commit comments

Comments
 (0)