ColorBox-Implementierung Teil 1

This commit is contained in:
starcalc 2017-12-08 00:05:49 +01:00
parent 54fbb46f25
commit 69cd6ed956
3 changed files with 11 additions and 1 deletions

View File

@ -144,6 +144,7 @@ void NeoPatterns::TheaterChase(uint32_t color1, uint32_t color2, uint8_t interva
Index = 0; Index = 0;
Direction = dir; Direction = dir;
} }
void NeoPatterns::TheaterChaseUpdate() { void NeoPatterns::TheaterChaseUpdate() {
for (int i = 0; i < numPixels(); i++) for (int i = 0; i < numPixels(); i++)
{ {
@ -504,6 +505,13 @@ void NeoPatterns::ColorSet(uint32_t color)
show(); show();
} }
void NeoPatterns::colorBox(uint8_t boxid, uint32_t c){ //color a box
for (int i=boxid*3;i<(boxid+1)*3;i++) {
setPixelColor(i, c);
}
}
void NeoPatterns::ColorSetParameters(String parameters) void NeoPatterns::ColorSetParameters(String parameters)
{ {
None(); None();

View File

@ -39,6 +39,7 @@ class NeoPatterns : public Adafruit_NeoPixel
void SetColor2(uint32_t color); void SetColor2(uint32_t color);
//Utilities //Utilities
void ColorSet(uint32_t color); void ColorSet(uint32_t color);
void colorBox(uint8_t boxid, uint32_t c);
void ColorSetParameters(String parameters); void ColorSetParameters(String parameters);
uint8_t Red(uint32_t color); uint8_t Red(uint32_t color);
uint8_t Green(uint32_t color); uint8_t Green(uint32_t color);

View File

@ -5,7 +5,8 @@
#include "NeoPatterns.h" #include "NeoPatterns.h"
#define PIN D6 #define PIN D6
#define NUMPIXELS 81 #define BIGPIXELS 20
#define NUMPIXELS * 3 // 3 LEDs form one pixel
NeoPatterns strip = NeoPatterns(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ400, &StripComplete); NeoPatterns strip = NeoPatterns(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ400, &StripComplete);
// NeoPatterns strip = NeoPatterns(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ400, &StripComplete); // NeoPatterns strip = NeoPatterns(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ400, &StripComplete);