--local side =peripheral.getNames()
local pneu = peripheral.wrap("bottom")
local mon = peripheral.wrap("back")
function Anzeige()
mon.setTextColor(colors.white)
mon.clear()
mon.setCursorPos(1,1)
mon.write("Aktueller Durck:")
mon.setCursorPos(1,5)
mon.write("Generator: ")
--mon.setCursorPos(1,4)
-- mon.write("Luftmenge: ")
mon.setTextColor(color)
mon.setCursorPos(1,2)
mon.write(string.format("%.2f",pressure).. "bar")
mon.setCursorPos(12,5)
mon.write(status)
-- mon.setCursorPos(1,4)
end
function Auto()
if pressure > 4.6 then
rs.setOutput("bottom",false)
rs.setOutput("left",false)
color = colors.red
status = "off"
elseif pressure < 4.0 then
rs.setOutput("bottom",true)
rs.setOutput("left",true)
color = colors.green
status = "on"
else
if pressure > 4.6 then
status = "off"
else
status = "on"
end
color = colors.orange
end
end
while true do
pressure = pneu.getPressure()
-- air = pneu.getAir()
Auto()
Anzeige()
sleep(0.5)
end
Comments
0 B
|👍
/👎
0 B
|0 👍
/0 👎
0 B
|👍
/👎