Browse Source

test pour la couleur

master
Julien Cabillot 3 years ago
committed by JC
parent
commit
c2fe8b118f
1 changed files with 6 additions and 1 deletions
  1. 7
      mqttfastledmenu.ino

7
mqttfastledmenu.ino

@ -116,7 +116,12 @@ void callbackMQTT(char* topic, byte* payload, unsigned int length)
FastLED.setBrightness(brightness);
client.publish(MQTT_LED_BRIGHTNESS_STATE, message_buff, true);
} else if (stopic == MQTT_LED_COLOR_COMMAND) {
color = msgString.toInt();
// Sample : 134,168,255
color = CRGB(
msgString.substring(0,3).toInt(),
msgString.substring(4,7).toInt(),
msgString.substring(8,11).toInt()
);
client.publish(MQTT_LED_COLOR_STATE, message_buff, true);
} else if (stopic == MQTT_LED_SPEED_COMMAND) {
speed = msgString.toInt();

Loading…
Cancel
Save