This commit is contained in:
2025-06-14 17:02:44 -04:00
parent 3297944cda
commit 904309aa0f
6 changed files with 99 additions and 28 deletions

View File

@@ -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()