Advertisement
iananderson

Untitled

Jun 15th, 2014
190
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. write("Enter Setpoint: ")
  5. input = tonumber(read())
  6.  
  7. while true do
  8.   x = p.getPressure()
  9.   y = input
  10.  
  11.   monitor.setTextScale(0.5)
  12.   monitor.setCursorPos(1,1)
  13.   monitor.write("Pressure:")
  14.   monitor.setCursorPos(1,2)
  15.   monitor.write(string.format("%.2e", x))
  16.   sleep(1)
  17.   monitor.clear()
  18.   monitor.setCursorPos(1,1)
  19.  
  20.   if x > y then
  21.      rs.setOutput("right",false)
  22.   else
  23.     rs.setOutput("right",true)
  24.   end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement