updated
This commit is contained in:
26
main.lua
26
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)
|
||||
@@ -25,6 +48,3 @@ local function run()
|
||||
-- monitor.scroll(1)
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
|
||||
return { run = run }
|
||||
@@ -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 }
|
||||
Reference in New Issue
Block a user