This commit is contained in:
2025-06-14 13:00:56 -04:00
parent 167b8be4b0
commit d979871c48

View File

@@ -1,16 +1,21 @@
local function run()
local kernel = require("kernel")
local tempDriver = kernel.addDriver("temperature_driver")
local coolantDriver = kernel.addDriver("coolant_driver")
local reactor = peripheral.find("fissionReactorLogicAdapter")
local monitor = peripheral.find("monitor")
local kernel = require("kernel")
local tempDriver = kernel.addDriver("temperature_driver")
local coolantDriver = kernel.addDriver("coolant_driver")
local reactor = peripheral.find("fissionReactorLogicAdapter")
local monitor = peripheral.find("monitor")
local function runMonitors()
while true do
tempDriver.watch(reactor, monitor)
coolantDriver.watch(reactor, monitor)
sleep(1)
end
end
local function runDisplay()
while true do
monitor.clear()
monitor.setCursorPos(1,1)
tempDriver.watch(reactor, monitor)
coolantDriver.watch(reactor, monitor)
local data = {
{ Label = "Temperature", value = tempDriver.report(reactor)},
{ Label = "Coolant", value = coolantDriver.report(reactor) },
@@ -26,7 +31,11 @@ local function run()
end
end
return { run = run }
local function run()
parallel.waitForAll(runMonitors, runDisplay)
end
return { run = run}
-- local monitor = peripheral.wrap("top")
-- local modem = peripheral.wrap("back")