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.
First off, I got it working with a bunch of Serial.print* commands. It was a logic error. Well three or four to be honest…
I have insane amounts of problems with my IDE. It sometimes compiles a new binary, and sometimes doesn’t. I then have to change the target type. If that doesn’t help, I delete the file structure, replace the moded files, run NPM install, and have another go at it. If that doesn’t work, I have to delete the "%userprofile%.platformio directory as well. Are others having these issues, or is it my configuration?
Anyhow, this is what I changed (between “Daro Mod Begin” and “Daro Mod End”), should anyone else want to add this functionality.
I have no clue what that means yet, but I will look into it.
Edit 1. First look: Am I seeing that correctly that forking is making a copy of the repository, and it is only possible for the entire branch(?), not for the individual mod? ACTUALLY: Should this be a different topic?
Edit 2. If I fork the whole repository, create a new branch, change the one user mod, commit it, and share it, am I responsible for keeping everything else up to date, or will everything else not moded by me come from the original?