From 646d3369fbd6c9c46608fdadca9ed1400d0f2c84 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Thu, 30 May 2019 13:08:24 +0200 Subject: [PATCH] Amount of new Pixels per loop for confetti effect is now configurable. Also, the color is based on a slowly rotating baseHue. --- include/prototypes.h | 2 ++ src/effect_confetti.cpp | 5 ++++- src/pitrix.cpp | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/prototypes.h b/include/prototypes.h index 3f6fe6c..78ea87c 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -34,4 +34,6 @@ typedef struct Matrix { double a22; } Matrix; +extern uint8_t baseHue; + #endif diff --git a/src/effect_confetti.cpp b/src/effect_confetti.cpp index 9830ea1..3599d47 100644 --- a/src/effect_confetti.cpp +++ b/src/effect_confetti.cpp @@ -1,10 +1,13 @@ #include "effect_confetti.h" #include "config.h" #include "functions.h" +#include "prototypes.h" void ConfettiEffect::loop() { fadeToBlackBy(leds, LED_COUNT, 1); - addPixelColor(random16(LED_COUNT), CHSV(random8(), 200, 255)); + for (int i=0; iloop();