updated
This commit is contained in:
28
main.lua
28
main.lua
@@ -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 }
|
|
||||||
@@ -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