Optimisation de l'allumage

main
Alex 2022-06-12 18:02:59 +02:00
parent 15fd42805e
commit 0af54b04b8
3 changed files with 2 additions and 39 deletions

View File

@ -15,7 +15,7 @@
#include <Arduino.h>
//#define ModeDebug
const String firmwareActualVersion = "1.0.0";
const String firmwareActualVersion = "1.1.0";
#ifdef ModeDebug
#define DEBUG(message) \
@ -49,7 +49,6 @@ int LED_COUNT = 66;
// LEDS
boolean g_BOO_AnimationSeconde = true;
#include "my_leds.h"
@ -104,8 +103,6 @@ void setup() {
strip.show(); // Turn OFF all pixels ASAP
strip.setBrightness(255);
LED_Animation(5);
g_BOO_AnimationSeconde = true;
DEBUG("************************** Tout est initialise");
}
@ -120,10 +117,6 @@ void setup() {
unsigned long lastRecu = 0;
int numled = 0;
void loop() {
// On écoute le serveur OTA
// OTA_doUpdate();
// Test si la connection Wifi existe toujours ...................................
if (WiFi.status() != WL_CONNECTED) {
// Si on est déconnecté on tente de se reconnecter automatiquement avec les anciens settings.
@ -145,28 +138,6 @@ void loop() {
// Animation des LEDS toutes les secondes .........................................
if (millis() - lastRecu > 1000 ) {
lastRecu = millis();
// Allumage d'une led
if ( g_BOO_AnimationSeconde ) {
if ( numled >= LED_COUNT /2 ) {
LED_AllumeBaton( numled -1, 0,0,0 ); // Noir
LED_AllumeBaton( numled -2, 0,0,0 ); // Noir
numled = 0;
}
LED_AllumeBaton( numled, 255,0,100 ); // Rouge
LED_AllumeBaton( numled -1, 50,0,70 ); // Noir
LED_AllumeBaton( numled -2, 0,0,0 ); // Noir
numled++;
}
}
// Traitement des Messages MQTT ...................................................
// Tout est fait dans MQTT_callback()
}
}

View File

@ -88,16 +88,12 @@ void MQTT_callback(char* topic, byte* payload, unsigned int length) {
if ( String( message ) == "ON") {
DEBUG("Allumage les leds");
c.B = 255;
LED_changeCouleur( c, 10 );
} else if ( String( message ) == "OFF") {
DEBUG("Extinction des leds");
LED_changeCouleurInverse( c, 1 );
}
g_BOO_AnimationSeconde = false;
// .....................................................................................
} else if ( strcmp( topic, topic_lumiere_color) == 0) {

View File

@ -299,7 +299,6 @@ void LED_Remplissage(unsigned int value){
// [1..9]
//
void LED_Animation(int num) {
g_BOO_AnimationSeconde = false;
DEBUG(num);
switch ( num ) {
case 0:
@ -320,9 +319,6 @@ void LED_Animation(int num) {
case 5:
rainbowCycle(10);
break;
case 6:
g_BOO_AnimationSeconde = true;
break;
default:
DEBUG("Animation inconnue ->" + String(num) );
break;