Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MrDj 2014
- screen = true --set to "true" if you have a screen and to "false" if not
- screenSide = "top"
- valveSide = "bottom"
- outSide = "back"
- valve=peripheral.wrap(valveSide)
- function Screen(crnt, side)
- if screen == true then
- mon=peripheral.wrap(side)
- mon.clear()
- mon.setCursorPos(1, 1)
- mon.write(crnt)
- else
- --nothin :)
- end
- end
- function off()
- rs.setOutput(outSide, true)
- end
- function on()
- rs.setOutput(outSide, false)
- end
- while true do
- current = valve.getPressure()
- max = valve.getDangerPressure()
- myMax = max - 0.1
- Screen(current, screenSide)
- shell.run("clear")
- print("Current Pressure: "..current)
- sleep(1)
- while current>=myMax do
- current = valve.getPressure()
- off()
- rs.setOutput(valveSide, true)
- print("Current Pressure: "..current)
- print("Releasing air!")
- sleep(.25)
- shell.run("clear")
- end
- on()
- rs.setOutput(valveSide, false)
- end
Advertisement
Add Comment
Please, Sign In to add comment