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

Commit ecea592

Browse files
committed
Added APA102 device to factory
1 parent bd9a5d1 commit ecea592

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libsrc/leddevice/LedDeviceFactory.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "LedDeviceLpd8806.h"
1515
#include "LedDeviceP9813.h"
1616
#include "LedDeviceWs2801.h"
17+
#include "LedDeviceAPA102.h"
1718
#endif
1819

1920
#ifdef ENABLE_TINKERFORGE
@@ -85,6 +86,15 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
8586
deviceP9813->open();
8687

8788
device = deviceP9813;
89+
else if (type == "apa102")
90+
{
91+
const std::string output = deviceConfig["output"].asString();
92+
const unsigned rate = deviceConfig["rate"].asInt();
93+
94+
LedDeviceAPA102* deviceAPA102 = new LedDeviceAPA102(output, rate);
95+
deviceAPA102->open();
96+
97+
device = deviceAPA102;
8898
}
8999
else if (type == "ws2801" || type == "lightberry")
90100
{

0 commit comments

Comments
 (0)