Browse Source

Changement du remplissage pour éviter les flash

main
Alex 2 years ago
parent
commit
78f085915d
2 changed files with 12 additions and 9 deletions
  1. 1
    1
      src/main.cpp
  2. 11
    8
      src/my_leds.h

+ 1
- 1
src/main.cpp View File

@@ -15,7 +15,7 @@
#include <Arduino.h>
//#define ModeDebug

const String firmwareActualVersion = "1.1.0";
const String firmwareActualVersion = "1.1.1";

#ifdef ModeDebug
#define DEBUG(message) \

+ 11
- 8
src/my_leds.h View File

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



Loading…
Cancel
Save