remove pixel stuff

This commit is contained in:
2018-09-02 03:04:14 +02:00
parent 2c79d7896c
commit 824479e8c6
6 changed files with 1 additions and 213 deletions

View File

@@ -1,44 +0,0 @@
#ifndef __PIXEL_PLUGIN__
#define __PIXEL_PLUGIN__
#define _TASK_SLEEP_ON_IDLE_RUN
#define _TASK_STD_FUNCTION
#include "TaskSchedulerDeclarations.h"
#include "MeshNet.h"
#include "Plugin.h"
#include "NeoPattern.cpp"
using namespace std;
using namespace std::placeholders;
class PixelPlugin : public Plugin {
private:
NeoPixelConfig pixelConfig;
NeoPattern* pixels;
public:
Task animation;
PixelPlugin(NeoPixelConfig cfg, NeoPattern* neoPattern){
pixelConfig = cfg;
pixels = neoPattern;
pixels->begin();
pixels->setBrightness(pixelConfig.brightness);
}
void activate(Scheduler* userScheduler, Network* network){
animation.set(TASK_MILLISECOND * pixelConfig.updateInterval, TASK_FOREVER, bind(&PixelPlugin::animate, this));
userScheduler->addTask(animation);
animation.enable();
Serial.println("NeoPixels activated");
}
void animate(){
pixels->Update();
}
void enable(){
animation.enable();
}
void disable(){
animation.disable();
}
};
#endif