updated
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
|
||||
local function getValue(reactor)
|
||||
local function getValue()
|
||||
local kelvin = reactor.getTemperature() or 0
|
||||
local fahrenheit = (kelvin - 273.15) * 9 / 5 + 32
|
||||
return math.floor(fahrenheit * 10000 + 0.5) / 10000
|
||||
end
|
||||
|
||||
local function color(reactor)
|
||||
local temperature = getValue(reactor)
|
||||
local function color()
|
||||
local temperature = getValue()
|
||||
return colors.black
|
||||
end
|
||||
|
||||
local function watch(reactor, monitor)
|
||||
print("Temperature: " .. getValue(reactor))
|
||||
local function watch()
|
||||
print("Temperature: " .. getValue())
|
||||
sleep(1)
|
||||
end
|
||||
|
||||
local function report(reactor, monitor)
|
||||
local value = getValue(reactor)
|
||||
local color = color(reactor)
|
||||
local function report()
|
||||
local value = getValue()
|
||||
local color = color()
|
||||
monitor.setBackgroundColor(color)
|
||||
monitor.clearLine()
|
||||
monitor.write("Temperature: " .. value .. "F")
|
||||
|
||||
Reference in New Issue
Block a user