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(); }