Logic Machine Forum
CANx dimming - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: CANx dimming (/showthread.php?tid=3920)



CANx dimming - AnLi_HOUSE - 06.03.2022

I would like to dim the light over CAN-UI10 device with 10 one-bit inputs  and IKEA LED strip for dimming.
IKEA has opportunity to dim either with 4 bit or with one byte. Who can help me to develop a script which will do a following: by clicking a button and holding the light will increase brightness for 5% every 0,5 second. And by clicking another button and holding the light will decrease brightness for 5% every 0,5 second. I'm ready to pay for this job.


RE: CANx dimming - admin - 07.03.2022

You can convert 1 bit start/stop to 4 bit up/down/stop via a simple script.

Press (true) = Up, Release (false) = Stop
Code:
value = event.getvalue() and 9 or 0
grp.write('32/1/1', value, dt.bit4)

Press (true) = Down, Release (false) = Stop
Code:
value = event.getvalue() and 1 or 0
grp.write('32/1/2', value, dt.bit4)