Advertisement
FoxWorn3365

Gestione Elettrica Titanus (NON_GUI)

Aug 2nd, 2021
863
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("left")
  2.  
  3. lato = "front"
  4.  
  5. rs.setOutput(lato, false)
  6.  
  7. while true do
  8. local id, msg, ptrc = rednet.receive()
  9. inp = rs.getInput(lato)
  10. if msg == "status" then
  11.   print("SATTUS")
  12.     if inp == false then
  13.     rednet.send(id, "ON")
  14.   elseif inp == true then
  15.     rednet.send(id, "OFF")
  16.   else
  17.     rednet.send(id, "ERROR")
  18.   end
  19. elseif msg == "ON" then
  20.   rs.setOutput(lato, false)
  21. else
  22.   rs.setOutput(lato, true)
  23. end
  24. sleep(0.1)
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement