Logic Machine Forum
Reduce 0-100% to 10-100% - 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: Reduce 0-100% to 10-100% (/showthread.php?tid=3212)



Reduce 0-100% to 10-100% - Rune - 10.03.2021

Hi!

What is the easiest way in the LM to reduce a 1 byte in percent from 0-100 to 10-100? I got a group address I want to send throug a "filter" and the result have to be from 10 to 100%.

Any ideas?  Smile


Reduce 0-100% to 10-100% - tomnord - 10.03.2021

So minimum neds to be 10? Scaled so that 0=10 or that 10=10 but the output does not go lower?

Sent fra min SM-G980F via Tapatalk


RE: Reduce 0-100% to 10-100% - Rune - 10.03.2021

(10.03.2021, 19:43)tomnord Wrote: So minimum neds to be 10? Scaled so that 0=10 or that 10=10 but the output does not go lower?

Sent fra min SM-G980F via Tapatalk

Yes, minimum 10%. 0 - 10 is equal 10, 11 = 11 %.


RE: Reduce 0-100% to 10-100% - tomnord - 10.03.2021

(10.03.2021, 19:48)Rune Wrote:
(10.03.2021, 19:43)tomnord Wrote: So minimum neds to be 10? Scaled so that 0=10 or that 10=10 but the output does not go lower?

Sent fra min SM-G980F via Tapatalk

Yes, minimum 10%. 0 - 10 is equal 10, 11 = 11 %.
Event based script:

value = event.getvalue()



if value < 10 then
output = 10
else
output = value
end


grp.write('1/1/1', output)

Sent fra min SM-G980F via Tapatalk

Event based script with the 0-100 value GA as trigger.

Sent fra min SM-G980F via Tapatalk

At output you can use "grp.update('1/1/1', output) also...

Sent fra min SM-G980F via Tapatalk