test pour la couleur

This commit is contained in:
Julien Cabillot 2017-03-06 13:33:46 +01:00 committed by JC
parent 09edbe02f6
commit c2fe8b118f

View File

@ -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();