Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Seite des Kompressors
- sc = "top"
- --NIX
- comp = peripheral.wrap(sc)
- mon = peripheral.find("monitor")
- while true do
- mon.setCursorPos(1,1)
- mon.write("Druck: ")
- if comp.getPressure() >= 5 then
- mon.setCursorPos(8,1)
- mon.setTextColor(colors.red)
- mon.write(comp.getPressure())
- elseif comp.getPressure() >= 1 then
- mon.setTextColor(colors.yellow)
- mon.write(comp.getPressure())
- elseif comp.getPressure() >= 4.3 and <= 5 then
- mon.setTextColor(colors.lime)
- mon.write(comp.getPressure())
- end
- mon.setCurorPos(13,1)
- mon.setTextColor(colors.white)
- mon.write("Bar ")
- mon.setCursorPos(1,2)
- mon.write("Temp.: "..comp.getTemperature().. " C ")
- mon.setCursorPos(1,3)
- mon.write("Status: ")
- if comp.getPressure() >= 4.3 and <= 5 then
- rs.setOutput(sc, true)
- mon.setTextColor(colors.red)
- mon.setCursorPos(9,3)
- mon.write("DEAKTIVIERT")
- mon.setTextColor(colors.white)
- elseif comp.getPressure() <= 4.3 then
- rs.setOutput(sc, false)
- mon.setTextColor(colors.lime)
- mon.setCursorPos(9,3)
- mon.write("AKTIVIERT ")
- mon.setTextColor(colors.white)
- end
- sleep(0.05)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement