|
@@ -47,7 +47,7 @@ class NeoPatterns : public Adafruit_NeoP
|
|
|
|
|
|
uint16_t Interval;
|
|
|
unsigned long lastUpdate;
|
|
|
uint32_t Color1;
|
|
|
uint32_t PixelColor;
|
|
|
uint16_t TotalSteps;
|
|
|
uint16_t Index;
|
|
|
|
|
@@ -121,12 +121,12 @@ class NeoPatterns : public Adafruit_NeoP
|
|
|
ActivePattern = COLOR_WIPE;
|
|
|
Interval = interval;
|
|
|
TotalSteps = numPixels();
|
|
|
Color1 = color;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void ColorWipeUpdate() {
|
|
|
setPixelColor(Index, Color1);
|
|
|
setPixelColor(Index, PixelColor);
|
|
|
Increment();
|
|
|
}
|
|
|
|
|
@@ -134,31 +134,31 @@ class NeoPatterns : public Adafruit_NeoP
|
|
|
ActivePattern = DOUBLE_COLOR_WIPE;
|
|
|
Interval = interval;
|
|
|
TotalSteps = numPixels() / 2;
|
|
|
Color1 = color;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void DoubleColorWipeUpdate() {
|
|
|
setPixelColor(Index, Color1);
|
|
|
setPixelColor(numPixels() - 1 - Index, Color1);
|
|
|
setPixelColor(Index, PixelColor);
|
|
|
setPixelColor(numPixels() - 1 - Index, PixelColor);
|
|
|
Increment();
|
|
|
}
|
|
|
|
|
|
void Scanner(uint32_t color1, uint16_t interval) {
|
|
|
void Scanner(uint32_t color, uint16_t interval) {
|
|
|
ActivePattern = SCANNER;
|
|
|
Interval = interval;
|
|
|
TotalSteps = (numPixels() - 1) * 2;
|
|
|
Color1 = color1;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void ScannerUpdate() {
|
|
|
for (int i = 0; i < numPixels(); i++) {
|
|
|
if (i == Index) {
|
|
|
setPixelColor(i, Color1);
|
|
|
setPixelColor(i, PixelColor);
|
|
|
}
|
|
|
else if (i == TotalSteps - Index) {
|
|
|
setPixelColor(i, Color1);
|
|
|
setPixelColor(i, PixelColor);
|
|
|
}
|
|
|
else {
|
|
|
setPixelColor(i, DimColor(getPixelColor(i)));
|
|
@@ -167,19 +167,19 @@ class NeoPatterns : public Adafruit_NeoP
|
|
|
Increment();
|
|
|
}
|
|
|
|
|
|
void DoubleScanner(uint32_t color1, uint16_t interval) {
|
|
|
void DoubleScanner(uint32_t color, uint16_t interval) {
|
|
|
ActivePattern = DOUBLE_SCANNER;
|
|
|
Interval = interval;
|
|
|
TotalSteps = (numPixels() / 2);
|
|
|
Color1 = color1;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void DoubleScannerUpdate() {
|
|
|
for (int i = 0; i < numPixels() / 2; i++) {
|
|
|
if (i == Index) {
|
|
|
setPixelColor(i, Color1); // First Eye
|
|
|
setPixelColor(numPixels() - 1 - i, Color1); // Second Eye
|
|
|
setPixelColor(i, PixelColor); // First Eye
|
|
|
setPixelColor(numPixels() - 1 - i, PixelColor); // Second Eye
|
|
|
}
|
|
|
else {
|
|
|
setPixelColor(i, DimColor(getPixelColor(i)));
|
|
@@ -190,49 +190,49 @@ class NeoPatterns : public Adafruit_NeoP
|
|
|
Increment();
|
|
|
}
|
|
|
|
|
|
void Random(uint32_t color1, uint16_t steps, uint16_t interval) {
|
|
|
void Random(uint32_t color, uint16_t steps, uint16_t interval) {
|
|
|
ActivePattern = RANDOM;
|
|
|
Interval = interval;
|
|
|
TotalSteps = steps;
|
|
|
Color1 = color1;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void RandomUpdate() {
|
|
|
setPixelColor(random(numPixels()), Color1);
|
|
|
setPixelColor(random(numPixels()), PixelColor);
|
|
|
Increment();
|
|
|
}
|
|
|
|
|
|
void DoubleRandom(uint32_t color1, uint16_t steps, uint16_t interval) {
|
|
|
void DoubleRandom(uint32_t color, uint16_t steps, uint16_t interval) {
|
|
|
ActivePattern = DOUBLE_RANDOM;
|
|
|
Interval = interval;
|
|
|
TotalSteps = steps;
|
|
|
Color1 = color1;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void DoubleRandomUpdate() {
|
|
|
int i = random(numPixels() / 2);
|
|
|
setPixelColor(i, Color1);
|
|
|
setPixelColor(numPixels() - 1 - i, Color1);
|
|
|
setPixelColor(i, PixelColor);
|
|
|
setPixelColor(numPixels() - 1 - i, PixelColor);
|
|
|
Increment();
|
|
|
}
|
|
|
|
|
|
void Blink(uint32_t color1, uint16_t steps, uint16_t interval) {
|
|
|
void Blink(uint32_t color, uint16_t steps, uint16_t interval) {
|
|
|
ActivePattern = BLINK;
|
|
|
Interval = interval;
|
|
|
if (steps % 2 != 0) {
|
|
|
steps++;
|
|
|
}
|
|
|
TotalSteps = steps;
|
|
|
Color1 = color1;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void BlinkUpdate() {
|
|
|
uint32_t c;
|
|
|
if (Index % 2 == 0) {
|
|
|
c = Color1;
|
|
|
c = PixelColor;
|
|
|
} else {
|
|
|
c = Color(0, 0, 0);
|
|
|
}
|
|
@@ -240,18 +240,18 @@ class NeoPatterns : public Adafruit_NeoP
|
|
|
Increment();
|
|
|
}
|
|
|
|
|
|
void Dot(uint32_t color1, uint16_t steps, uint16_t interval) {
|
|
|
void Dot(uint32_t color, uint16_t steps, uint16_t interval) {
|
|
|
ActivePattern = DOT;
|
|
|
Interval = interval;
|
|
|
TotalSteps = steps;
|
|
|
Color1 = color1;
|
|
|
PixelColor = color;
|
|
|
Index = 0;
|
|
|
}
|
|
|
|
|
|
void DotUpdate() {
|
|
|
ColorSet(Color(0, 0, 0));
|
|
|
show();
|
|
|
setPixelColor(random(numPixels()), Color1);
|
|
|
setPixelColor(random(numPixels()), PixelColor);
|
|
|
Increment();
|
|
|
}
|
|
|
|