Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m= peripheral.wrap("left")
- m.AddAlert("testalarm1","1:0",10,50)
- m.AddAlert("testalarm2","1:0",10,0)
- m.AddAlert("testalarm3","1:0",0,50)
- while true do
- local event,param1 = os.pullEvent()
- if event == "testalarm1" then
- print("range alarm "..param1)
- elseif event == "testalarm2" then
- print("min alarm " ..param1)
- elseif event == "testalarm3" then
- print("max alarm " .. param1)
- else
- sleep(1.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment