25.10.2021, 11:12
Hi again,
Based on the proposed solution
(https://forum.logicmachine.net/showthrea...d=74#pid74)
and thread:
https://forum.logicmachine.net/showthrea...4#pid15204
I have made a edje detection group of scripts which I attach.
'Resident (edje detection).lua' detects and counts pulses. When new pulse is present, a timer is created with help of 'common function.lua' and a corresponding 'timer off' is triggered with help of 'Resident Timer Off.lua' script. In the meanwhile new pulses are counted. At the timeout of timer the 'Typical Event Script.lua' is triggered with value of counter at that time and thus the proper action is executed.
The scripts work really well and detect concurrent pulses from different G.A. Also, when long pressing a button you don' t have to release it in order to execute the action. In addition you can set different timeout for each G.A.
However the issue I have is that it takes more than a second to apply action.
The scripts work only then setting 'Resident Timer Off.lua' with sleep time 1sec. So, I guess that this is the reason for longer delay. If I set 0 it does not work properly.
So, question is:
- Is it possible to set multiple resident scripts with sleep time 0 and if yes what is the reason for improper function in my case.
- Is there any way to reduce edge detection and corresponding actions to fractions of 1 sec.
- Is it possible to dublicate 'Resident (edje detection).lua' and run in parallel in order to organize the edge detections (lights and scenes).
Thanks in advance!
Based on the proposed solution
(https://forum.logicmachine.net/showthrea...d=74#pid74)
and thread:
https://forum.logicmachine.net/showthrea...4#pid15204
I have made a edje detection group of scripts which I attach.
'Resident (edje detection).lua' detects and counts pulses. When new pulse is present, a timer is created with help of 'common function.lua' and a corresponding 'timer off' is triggered with help of 'Resident Timer Off.lua' script. In the meanwhile new pulses are counted. At the timeout of timer the 'Typical Event Script.lua' is triggered with value of counter at that time and thus the proper action is executed.
The scripts work really well and detect concurrent pulses from different G.A. Also, when long pressing a button you don' t have to release it in order to execute the action. In addition you can set different timeout for each G.A.
However the issue I have is that it takes more than a second to apply action.
The scripts work only then setting 'Resident Timer Off.lua' with sleep time 1sec. So, I guess that this is the reason for longer delay. If I set 0 it does not work properly.
So, question is:
- Is it possible to set multiple resident scripts with sleep time 0 and if yes what is the reason for improper function in my case.
- Is there any way to reduce edge detection and corresponding actions to fractions of 1 sec.
- Is it possible to dublicate 'Resident (edje detection).lua' and run in parallel in order to organize the edge detections (lights and scenes).
Thanks in advance!
Resident (edje detection).lua (Size: 2.43 KB / Downloads: 6)
Common Function.lua (Size: 281 bytes / Downloads: 7)
Resident Timer Off.lua (Size: 569 bytes / Downloads: 10)
Typical Event Script.lua (Size: 612 bytes / Downloads: 9)