APN paper, misc Lua

This commit is contained in:
2024-03-29 14:35:43 +00:00
parent 70af4fb244
commit 350698a352
11 changed files with 602 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
local modem = {peripheral.find("modem", function(_, o) return o.isWireless() end)}
local function send(...)
for _, modem in pairs(modem) do
modem.transmit(48869, 48869, {...})
end
end
local pipe = peripheral.wrap(settings.get "pipe")
local label = settings.get "label"
local ctrl = settings.get "control_output"
local target_pressure = settings.get "target"
while true do
local pressure = pipe.getPressure()
send("pressure/" .. label, "bars of pressure in measured pipe", pressure)
rs.setOutput(ctrl, pressure < target_pressure)
sleep(1)
end