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