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

#include <Arduino.h> #include <Arduino.h>
//#define ModeDebug //#define ModeDebug


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


#ifdef ModeDebug #ifdef ModeDebug
#define DEBUG(message) \ #define DEBUG(message) \

+ 11
- 8
src/my_leds.h View File

*/ */
void LED_Remplissage(unsigned int value){ 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 // ALLUMAGE DES LEDS
Couleur color; 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 // DEFINITION DE LA COULEUR
int value = 255 - i * 255/(LED_COUNT/2); int value = 255 - i * 255/(LED_COUNT/2);
color.R = 255 - value; color.R = 255 - value;
// ALLUMAGE DU BATON DE LEDS // ALLUMAGE DU BATON DE LEDS
LED_AllumeBaton(i, color ); 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