Multiplication and Divide in Rules ESPeasy

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bypbop
New user
Posts: 2
Joined: 06 May 2020, 23:51

Multiplication and Divide in Rules ESPeasy

#1 Post by bypbop » 07 May 2020, 00:01

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

TD-er
Core team member
Posts: 8729
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Multiplication and Divide in Rules ESPeasy

#2 Post by TD-er » 07 May 2020, 00:14

Why not just multiply by 4?

bypbop
New user
Posts: 2
Joined: 06 May 2020, 23:51

Re: Multiplication and Divide in Rules ESPeasy

#3 Post by bypbop » 07 May 2020, 00:34

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

goldfisheye
New user
Posts: 1
Joined: 18 Aug 2020, 10:55

Re: Multiplication and Divide in Rules ESPeasy

#4 Post by goldfisheye » 18 Aug 2020, 10:59

I'm looking for this information.
Thank you very much :D :D :D

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 7 guests