From a099833736367954003c41f77c584ca3c3fab87f Mon Sep 17 00:00:00 2001 From: Thomas Schmid Date: Sat, 25 Jun 2022 22:32:39 +0200 Subject: [PATCH] update fackel Signed-off-by: Thomas Schmid --- firmware/src/applications/fackel.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/firmware/src/applications/fackel.cpp b/firmware/src/applications/fackel.cpp index c7a3609..8c5ce58 100644 --- a/firmware/src/applications/fackel.cpp +++ b/firmware/src/applications/fackel.cpp @@ -5,14 +5,14 @@ #include #undef NUM_LEDS -#define NUM_LEDS 45 +#define NUM_LEDS 48 static unsigned long last_sample_time; static unsigned long sample_counter; static float rms_avg; -static uint8_t energy[NUM_LEDS]; -static uint8_t spark_energy[NUM_LEDS]; +static uint8_t energy[NUM_LEDS + 2]; +static uint8_t spark_energy[NUM_LEDS + 2]; char string[128]; Pt1 energy_pt1{1.f, 3.f}; @@ -147,16 +147,13 @@ void FackelApp::loop() EVERY_N_MILLISECONDS(45) { - update_energy(energy, NUM_LEDS); + update_energy(energy, NUM_LEDS+2); for (int i = 0; i < NUM_LEDS; i++) { - leds[NUM_LEDS-i-1] = palette[energy[i]]; + leds[NUM_LEDS-i-1] = palette[energy[i+2]]; } - - leds[NUM_LEDS-1] = leds[NUM_LEDS-3]; - leds[NUM_LEDS-2] = leds[NUM_LEDS-3]; FastLED.show(); } } \ No newline at end of file