externalize pixel stuff, add pixel instance to plugin, remove old code

This commit is contained in:
2018-11-05 14:57:49 +01:00
parent d4d40428cc
commit 99dbd8379b
8 changed files with 58 additions and 30 deletions

View File

@@ -66,6 +66,7 @@ class NeoPattern : public Adafruit_NeoPixel
frameBuffer = (uint8_t *)malloc(768);
OnComplete = callback;
TotalSteps = numPixels();
begin();
}
NeoPattern(uint16_t pixels, uint8_t pin, uint8_t type)
@@ -73,6 +74,7 @@ class NeoPattern : public Adafruit_NeoPixel
{
frameBuffer = (uint8_t *)malloc(768);
TotalSteps = numPixels();
begin();
}
void handleStream(uint8_t *data, size_t len)
@@ -386,6 +388,9 @@ class NeoPattern : public Adafruit_NeoPixel
return Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
}
/**
* Effects from https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
*/
void Fire(int Cooling, int Sparking)
{
byte heat[numPixels()];