I'm trying to figure out a fail-safe way to provide an output on GPIO pin of the Pi that would not be vulnerable to my (possibly) buggy code crashes. Is there a surefire way to do so?
Scenario: I need to put GPIO pin to HIGH for up to 30 seconds, while I observe sensor data to make a determination of what happens. If I observe desired conditions are met earlier, I need to pull pin LOW. But if my code crashes, I don't want the pin to remain HIGH for an hour or a day while I figure out that my code crashed.
Short of building a separate circuit (something like 555 timer), is there a way to do this with SoC instructions that would continue in a case of a crash?
PS: Just to clarify, the kind of crash I'm talking about is not Raspberry Pi crash, it's my application crash. Pi will continue idling, while my python process terminates unexpectedly.