Affichage du nombre de workers

main
Alex 2022-06-10 23:11:06 +02:00
parent 600e110e21
commit 15fd42805e
2 changed files with 18 additions and 3 deletions

View File

@ -14,6 +14,7 @@ char topic_lumiere_color[8 + 6 + DEVICEID_SIZE];
char topic_lumiere_bright[8 + 11 + DEVICEID_SIZE];
char topic_lumiere_anim[8 + 10 + DEVICEID_SIZE];
char topic_lumiere_rempli[8 + 7 + DEVICEID_SIZE];
char topic_lumiere_allume_barres[8 + 7 + 7 + DEVICEID_SIZE];
@ -140,6 +141,19 @@ void MQTT_callback(char* topic, byte* payload, unsigned int length) {
DEBUG("Detection du topics :" + String( topic_lumiere_rempli ));
DEBUG("Lancement du remplissage à :" + String( message ));
LED_Remplissage(String( message ).toInt());
// .....................................................................................
} else if ( strcmp( topic, topic_lumiere_allume_barres) ==0 ) {
DEBUG("Detection du topics :" + String( topic_lumiere_allume_barres ));
DEBUG("Lancement du remplissage des " + String( message ) + " barres");
Couleur color;
color.R = 255;
color.V = 255;
color.B = 255;
for(int i = 0; i < String( message ).toInt(); i++){
LED_AllumeBaton(i, color );
}
}
}
@ -169,4 +183,5 @@ void MQTT_setup(){
sprintf( topic_lumiere_bright, "lumiere/brightness/%s", DeviceID);
sprintf( topic_lumiere_anim, "lumiere/animation/%s", DeviceID);
sprintf( topic_lumiere_rempli, "lumiere/allume/%s", DeviceID);
sprintf( topic_lumiere_allume_barres, "lumiere/allume/%s/barres", DeviceID);
}

View File

@ -33,6 +33,9 @@ void LED_AllumeBaton(unsigned int num, Couleur color){
// ALLUMAGE LEDS DESCENDENTE
strip.setPixelColor(LED_COUNT-1 - num, strip.Color( color.R, color.V, color.B ));
// MISE À JOUR DU LED STRIP
strip.show();
}
void LED_AllumeBaton(unsigned int num, unsigned int R, unsigned int V, unsigned int B){
// ALLUMAGE LEDS MONTANTE
@ -285,9 +288,6 @@ void LED_Remplissage(unsigned int value){
// ALLUMAGE DU BATON DE LEDS
LED_AllumeBaton(i, color );
// MISE À JOUR DU LED STRIP
strip.show();
}
}