updated
This commit is contained in:
26
environment_driver.lua
Normal file
26
environment_driver.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
local function getValue()
|
||||
return environment.getRadiationLevel().radiation
|
||||
end
|
||||
|
||||
local function watch()
|
||||
while true do
|
||||
sleep(0.05) -- Update every tenth second
|
||||
end
|
||||
end
|
||||
|
||||
local function startUp()
|
||||
end
|
||||
|
||||
local function shutdown()
|
||||
end
|
||||
|
||||
local function report()
|
||||
local value = getValue()
|
||||
local color = colors.black
|
||||
monitor.setBackgroundColor(color)
|
||||
|
||||
setNewLine()
|
||||
monitor.write("Radiation Level: " .. tostring(value))
|
||||
end
|
||||
return { report = report, watch = watch, startUp = startUp, shutdown = shutdown }
|
||||
Reference in New Issue
Block a user