mirror of
https://gitlab.com/zwirbel/illucat.git
synced 2025-12-16 10:04:30 +01:00
remove dns server and newConn cb
This commit is contained in:
@@ -17,6 +17,7 @@ class PixelPlugin : public Plugin {
|
||||
private:
|
||||
NeoPixelConfig pixelConfig;
|
||||
NeoPattern* pixels;
|
||||
NeoPatternState state;
|
||||
public:
|
||||
Task animation;
|
||||
PixelPlugin(NeoPixelConfig cfg, NeoPattern* neoPattern){
|
||||
@@ -31,12 +32,17 @@ class PixelPlugin : public Plugin {
|
||||
subscribe("pixels/pattern", bind(&PixelPlugin::setPattern, this, _1));
|
||||
subscribe("pixels/totalSteps", bind(&PixelPlugin::setTotalSteps, this, _1));
|
||||
subscribe("pixels/brightness", bind(&PixelPlugin::setBrightness, this, _1));
|
||||
subscribe("pixels/state", bind(&PixelPlugin::setState, this, _1));
|
||||
|
||||
animation.set(TASK_MILLISECOND * pixelConfig.updateInterval, TASK_FOREVER, bind(&PixelPlugin::animate, this));
|
||||
userScheduler->addTask(animation);
|
||||
animation.enable();
|
||||
Serial.println("NeoPixels activated");
|
||||
}
|
||||
// TODO set the whole pixel state
|
||||
void setState(String msg){
|
||||
state.fromJsonString(msg);
|
||||
}
|
||||
void setTotalSteps(String msg){
|
||||
pixels->TotalSteps = atoi(msg.c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user