convert hexa to pwm values

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
rudloffl
Normal user
Posts: 43
Joined: 04 Jul 2019, 07:17

convert hexa to pwm values

#1 Post by rudloffl » 12 Sep 2019, 05:44

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

dirk_k
Normal user
Posts: 19
Joined: 19 Aug 2017, 22:41

Re: convert hexa to pwm values

#2 Post by dirk_k » 15 Sep 2019, 22:21

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests