Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("front")
- mon.clear()
- mon.setTextScale(1.5)
- mon.setCursorPos(2,1)
- mon.write("ON")
- mon.setCursorPos(2,3)
- mon.write("OFF")
- while true do
- event,side,x,y = os.pullEvent("monitor_touch")
- if x > 1 and x < 2 and y == 1 then
- rs.setOutput("left",true)
- mon.setCursorPos(2,1)
- mon.clearLine()
- mon.blit("ON","00000000","dddddddd")
- mon.setCursorPos(2,1)
- elseif x > 1 and x < 3 and y == 3 then
- rs.setOutput("left",false)
- mon.setCursorPos(2,3)
- mon.clearLine()
- mon.blit("OFF","00000","ddddd")
- mon.setCursorPos(2,3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement