Advertisement
iananderson

Untitled

Jun 15th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. p = peripheral.wrap("back")
  2. local monitor = peripheral.wrap("top")
  3.  
  4. while true do
  5.   x = p.getPressure()
  6.  
  7.   monitor.setTextScale(0.5)
  8.   monitor.setCursorPos(1,1)
  9.   monitor.write("Current Pressure:")
  10.   monitor.setCursorPos(1,2)
  11.   monitor.write(string.format("%.1x", x)
  12.   sleep(1)
  13.   monitor.clear()
  14.   monitor.setCursorPos(1,1)
  15.  
  16.   if x > 3 then
  17.      rs.setOutput("right",false)
  18.   else
  19.     rs.setOutput("right",true)
  20.   end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement