Some might know that I’m building a project where I’d like to minimize the potential of being a fire hazard.
I saw the BME 280 mod, and since I have a couple laying around, I figured that I’d give modding the mod a shot. Unfortunately I need a bit of assistance…
This is what I was thinking:
Add a variable to enable thermal shut down.
Add a variable to store the shutdown temperature.
Use those variables for the json configuration
Toggle brightness from x to 0 (turn off) if the current temperature is greater than or equal to the shutdown temperature.
Toggle brightness from 0 to whatever x was (turn on), if the current temperature is less than the shutdown temperature.
Anyway, it sort of does what I want, but the state doesn’t remain stable. If the temperature triggers shutdown, it goes off but the state then toggles every 4 - 6 seconds.
try offMode=true , this will do the same as pressing the power button in the UI. maybe there is a function you can call instead of just setting offMode.
and my inner if statements around 246 toggled it on and off as long as the temperature is above the threshold…
No problem. So I thought…
I added a variable (ThermalShutdownTriggered) that is (should be?) true if the temperature threshold is exceeded, and false when it dips below that and (a new variable for) a hysteresis so the lights don’t flap. It seems however that ThermalShutdownTriggered is never set to true, but I cannot tell.
I tried adding some Debug statements, and looked on the serial monitor, but don’t see anything. If I were programming for my PC, I could just let the debugger run and step through my code, but I don’t see any options for that. Is there a document that explains how?
Here it is. Maybe it’s blatantly obvious to someone else.