This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

blink light
#1
I have flood sensor witch sends me an alarm in case of flood. When the alarm state is triggered i need to make a light blink constantly until the alarm stops. 


I created an event-based script triggered by the state of the sensor and inside I created a while loop inside:

Code:
while grp.getvalue("stato sensore") do
  grp.write("luce", true)
  os.sleep(1)
  grp.write("luce", false)
  os.sleep(1)
end


Now it works but it easily overloads the CPU pretty easily. Is there a better way to do this?
Reply


Messages In This Thread
blink light - by Andrea Becagli - 18.03.2025, 09:58
RE: blink light - by admin - 18.03.2025, 10:02
RE: blink light - by Andrea Becagli - 18.03.2025, 10:16
RE: blink light - by admin - 18.03.2025, 11:05
RE: blink light - by Andrea Becagli - 18.03.2025, 11:53

Forum Jump: