Advertisement
ecco7777

CC day/night sensor (puls)

Mar 23rd, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. m=peripheral.wrap("front")
  2. t="Day"
  3. side="back"
  4. while true do
  5. if os.time()<=18.5 and os.time()>=6.0 and t=="Night" then
  6. t="Day"
  7. rs.setOutput(side,true)
  8. sleep(1)
  9. rs.setOutput(side,false)
  10. end
  11. if os.time()<=6.0 and os.time()>=18.5 and t=="Day" then
  12. t="Night"
  13. rs.setOutput(side,true)
  14. sleep(1)
  15. rs.setOutput(side,false)
  16. end
  17. sleep(1)
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement