Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.wrap("back")
- local monitor = peripheral.wrap("top")
- while true do
- x = p.getPressure()
- monitor.setTextScale(0.5)
- monitor.setCursorPos(1,1)
- monitor.write("Current Pressure:")
- monitor.setCursorPos(1,2)
- monitor.write(string.format("%.1x", x)
- sleep(1)
- monitor.clear()
- monitor.setCursorPos(1,1)
- if x > 3 then
- rs.setOutput("right",false)
- else
- rs.setOutput("right",true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement