updated
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
local max = 250
|
||||
local min = 212
|
||||
|
||||
|
||||
local function getValue()
|
||||
local kelvin = reactor.getTemperature() or 0
|
||||
@@ -11,8 +14,23 @@ local function color()
|
||||
end
|
||||
|
||||
local function watch()
|
||||
print("Temperature: " .. getValue())
|
||||
sleep(1)
|
||||
while true do
|
||||
print("Temperature: " .. getValue())
|
||||
checkTemperature()
|
||||
end
|
||||
end
|
||||
local function checkTemperature()
|
||||
local temperature = getValue()
|
||||
local upperThreshold = max - 20
|
||||
local lowerThreshold = min + 20
|
||||
|
||||
if temperature >= upperThreshold then
|
||||
print("Warning: Temperature approaching upper limit! Taking action.")
|
||||
burnRateDriver.stepDown()
|
||||
elseif temperature <= lowerThreshold then
|
||||
print("Warning: Temperature approaching lower limit! Taking action.")
|
||||
burnRateDriver.stepUp()
|
||||
end
|
||||
end
|
||||
|
||||
local function report()
|
||||
|
||||
Reference in New Issue
Block a user