Initialize modular ATM10 CC control system

This commit is contained in:
2026-07-13 02:46:11 +02:00
commit 5362d31036
28 changed files with 331 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
local constants = require("core.constants")
local protocol = require("core.protocol")
local M = {}
function M.open()
for _, name in ipairs(peripheral.getNames()) do
if peripheral.hasType(name, "modem") then rednet.open(name) end
end
return rednet.isOpen()
end
function M.broadcast(message) rednet.broadcast(message, constants.PROTOCOL) end
function M.send(id, message) return rednet.send(id, message, constants.PROTOCOL) end
function M.receive(timeout)
local sender, message = rednet.receive(constants.PROTOCOL, timeout)
if sender and protocol.valid(message) then return sender, message end
return nil, nil
end
return M