This commit is contained in:
2025-06-14 12:26:30 -04:00
parent b283d8e97f
commit 27f1429be4
2 changed files with 30 additions and 6 deletions

View File

@@ -1,5 +1,28 @@
local function run() local function run()
print("Running main loop") print("Running main loop")
while
local tempDriver = require("temperature_monitor")
while true do
monitor.clear()
monitor.setCursorPos(1,1)
local data = {
{ Label = "Temperature", value = tempDriver.report()},
{ Label = "Pressure", value = "101kPa" },
{ Label = "Humidity", value = "45%" }
}
for i, item in ipairs(data) do
monitor.write(item.Label .. ": " .. item.value)
monitor.setCursorPos(1, i + 1)
end
sleep(1)
end
end
return { run = run }
-- local monitor = peripheral.wrap("top") -- local monitor = peripheral.wrap("top")
-- local modem = peripheral.wrap("back") -- local modem = peripheral.wrap("back")
-- print(monitor) -- print(monitor)
@@ -24,7 +47,4 @@ local function run()
-- y=maxHeight -- y=maxHeight
-- monitor.scroll(1) -- monitor.scroll(1)
-- end -- end
-- end -- end
end
return { run = run }

View File

@@ -1,3 +1,7 @@
local reactor = peripheral.find("fissionReactorLogicAdapter")
local modem = peripheral.wrap("back")
local function report()
local reactor = peripheral.find("fissionReactorLogicAdapter")
return reactor.getTemerature()
end
return { report = report }