From 78f085915d536cbd4ed9c4eab171b8904c4a1aec Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 14 Jun 2022 23:35:27 +0200 Subject: [PATCH] =?UTF-8?q?Changement=20du=20remplissage=20pour=20=C3=A9vi?= =?UTF-8?q?ter=20les=20flash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 2 +- src/my_leds.h | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1d05f1d..602a6e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,7 @@ #include //#define ModeDebug -const String firmwareActualVersion = "1.1.0"; +const String firmwareActualVersion = "1.1.1"; #ifdef ModeDebug #define DEBUG(message) \ diff --git a/src/my_leds.h b/src/my_leds.h index 0e87ea7..7af09cd 100644 --- a/src/my_leds.h +++ b/src/my_leds.h @@ -269,16 +269,10 @@ void theaterChaseRainbow(uint8_t wait) { */ void LED_Remplissage(unsigned int value){ - // ON PASSE TOUTES LES LEDS EN NOIR - for (int i = 0; i < LED_COUNT; i++) { - strip.setPixelColor(i, strip.Color(0,0,0)); // Noir - } - strip.show(); - - // ALLUMAGE DES LEDS Couleur color; - for (int i = 0; i <= (int) ((LED_COUNT/2) * value / 100); i++) { + int max = (int) ((LED_COUNT/2) * value / 100); + for (int i = 0; i <= max; i++) { // DEFINITION DE LA COULEUR int value = 255 - i * 255/(LED_COUNT/2); color.R = 255 - value; @@ -289,6 +283,15 @@ void LED_Remplissage(unsigned int value){ // ALLUMAGE DU BATON DE LEDS LED_AllumeBaton(i, color ); } + + // ON PASSE TOUTES LES LEDS EN NOIR + color.R = 0; + color.V = 0; + color.B = 0; + for (int i = max +1; i < LED_COUNT / 2 ; i++) { + LED_AllumeBaton(i, color ); + } + strip.show(); }