From 27f1429be470ee0b21cc6622fb95bb5367d9451b Mon Sep 17 00:00:00 2001 From: itzmarkoni Date: Sat, 14 Jun 2025 12:26:30 -0400 Subject: [PATCH] updated --- main.lua | 28 ++++++++++++++++++++++++---- temperature_monitor.lua | 8 ++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/main.lua b/main.lua index 2c28d06..9fddaee 100644 --- a/main.lua +++ b/main.lua @@ -1,5 +1,28 @@ local function run() 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 modem = peripheral.wrap("back") -- print(monitor) @@ -24,7 +47,4 @@ local function run() -- y=maxHeight -- monitor.scroll(1) -- end - -- end -end - -return { run = run } \ No newline at end of file + -- end \ No newline at end of file diff --git a/temperature_monitor.lua b/temperature_monitor.lua index f14be3f..2755ece 100644 --- a/temperature_monitor.lua +++ b/temperature_monitor.lua @@ -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 } \ No newline at end of file