p = peripheral.wrap("back")
while true do
x = p.getPressure()
print(x)
if x > 3 then
rs.setOutput("left", true)
else
rs.setOutput("left", false)
end
sleep(5)
end
The idea behine this is to monitor the pressure from the pipes from a PneumaticCraft air pipes. It reads the pressure from the back of the pc from the pipes. When the pressure gets over 3.0 bars, It stops sending a redstone signal and stops the air compresser. When the pressure gets below 3.0 bars it starts the compressor again.
When I run the code. All I get is attemp to call nil.












