From c2fe8b118f395a3ea2a4d1245451fc02aa4158d5 Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Mon, 6 Mar 2017 13:33:46 +0100 Subject: [PATCH] test pour la couleur --- mqttfastledmenu.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mqttfastledmenu.ino b/mqttfastledmenu.ino index e8e657c..d61158d 100644 --- a/mqttfastledmenu.ino +++ b/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();