Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Licht

DerMarten Jul 19th, 2015 195 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. os.loadAPI("button")
  2. m = peripheral.wrap("back")
  3. m.clear()
  4. lichtRsSide = "left"
  5. lichtBool = false
  6. --------------------------------
  7. function fillTable()
  8.   button.setTable("Licht", licht, 3, 13, 3, 5)
  9.   button.screen()
  10. end
  11.  
  12. function getClickt()
  13.   event, side,x,y = os.pullEvent("monitor_touch")
  14.   button.checkxy(x,y)
  15. end
  16. function licht()
  17.   button.toggleButton("Licht")
  18.   write("Tag: ")
  19.   write(os.day())
  20.   write(" - Zeit: ")
  21.   write(os.time())
  22.   write(" - ")
  23.   if lichtBool == false then
  24.     rs.setOutput(lichtRsSide, true)
  25.     lichtBool = true
  26.     print("Licht an")
  27.   else
  28.     rs.setOutput(lichtRsSide, false)
  29.     lichtBool = false
  30.     print("Licht aus")
  31.     end
  32. end
  33. ----------------------------------
  34. fillTable()
  35. button.heading("Haus Steuerung")
  36. --button.label(4,7,"Nicht angeschlossen")
  37. while true do
  38.   getClickt()
  39. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top