updatedf
This commit is contained in:
31
main.lua
31
main.lua
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user