Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("back")
- m.clear()
- lichtRsSide = "left"
- lichtBool = false
- --------------------------------
- function fillTable()
- button.setTable("Licht", licht, 3, 13, 3, 5)
- button.screen()
- end
- function getClickt()
- event, side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function licht()
- button.toggleButton("Licht")
- write("Tag: ")
- write(os.day())
- write(" - Zeit: ")
- write(os.time())
- write(" - ")
- if lichtBool == false then
- rs.setOutput(lichtRsSide, true)
- lichtBool = true
- print("Licht an")
- else
- rs.setOutput(lichtRsSide, false)
- lichtBool = false
- print("Licht aus")
- end
- end
- ----------------------------------
- fillTable()
- button.heading("Haus Steuerung")
- --button.label(4,7,"Nicht angeschlossen")
- while true do
- getClickt()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement