Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---Monitor Control---
- mon = peripheral.wrap("top")
- term.redirect(mon)
- function clearMon()
- term.clear()
- term.setCursorPos(1,1)
- end
- ---Compressor Control---
- ac = peripheral.wrap("left")
- ---Alarm Control---
- alarmside = "back"
- function alarmOn()
- redstone.setOutput(alarmside, true)
- end
- function alarmOff()
- redstone.setOutput(alarmside, false)
- end
- -----------
- while true do
- pressure = ac.getPressure()
- print("CURRENT PRESSURE")
- print(pressure)
- if
- pressure > 4.9 then
- redstone.setOutput("left", true)
- alarmOn()
- print("PRESSURE OVERLOAD")
- print("COMPRESSOR DISABLED")
- else
- redstone.setOutput("left", false)
- alarmOff()
- print("PRESSURE RISING")
- end
- sleep(1)
- clearMon()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement