mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 13:25:03 +01:00
remove pixel stuff
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user