Page 1 of 1

convert hexa to pwm values

Posted: 12 Sep 2019, 05:44
by rudloffl
Hello all,

I'm working an a led ribbon system that will communicate with my home automation system (Jeedom via generic HTTP).
The home automation system can easily populate colors code (RGB) in hexa, e.g. #FFFFFF. I want the espeasy to read the code directly.

Is there a formula (not listed here : https://www.letscontrolit.com/wiki/inde ... asyFormula) that can convert Hex --> decimal ?
Is there a function to slide the code in 3 parts to work on the channel (RGB) independently ?

Any help is appreciated.

Thanks

Re: convert hexa to pwm values

Posted: 15 Sep 2019, 22:21
by dirk_k
i try something ... but as the result i send the decimal value for every color ... because ESPEasy don#t receive strings via MQTT.

so for FFFF00 i send 255 255 0

On MQTTRGB#LEDBlue do
NeoPixel,1,[MQTTRGB#LEDRed],[MQTTRGB#LEDBlue],[MQTTRGB#LEDGreen]
endon