Page 1 of 1

Multiplication and Divide in Rules ESPeasy

Posted: 07 May 2020, 00:01
by bypbop
Hi Everyone,

I try to transform 0 to 255 in 0 to 1023 for RGB Ledstrip but it doesn't work. Can you tell me why ?

Code: Select all

on RGB do
PWM,05,%eventvalue1%*1023/255
PWM,12,%eventvalue2%*1023/255
PWM,13,%eventvalue3%*1023/255
endon
Regards,
Bypbop

Re: Multiplication and Divide in Rules ESPeasy

Posted: 07 May 2020, 00:14
by TD-er
Why not just multiply by 4?

Re: Multiplication and Divide in Rules ESPeasy

Posted: 07 May 2020, 00:34
by bypbop
It's ok i have understand how to do !

Code: Select all

on STOP do
PWM,05,0
PWM,12,0
PWM,13,0
endon

on RGB do
TaskValueSet,04,1,%eventvalue1%*1023/255
TaskValueSet,04,2,%eventvalue2%*1023/255
TaskValueSet,04,3,%eventvalue3%*1023/255


PWM,05,[RGB#Red]
PWM,12,[RGB#Green]
PWM,13,[RGB#Blue]
endon

Re: Multiplication and Divide in Rules ESPeasy

Posted: 18 Aug 2020, 10:59
by goldfisheye
I'm looking for this information.
Thank you very much :D :D :D