Minimum time for digital signal reading

Hi all contributors.
The delay check feature from @alto777 works perfectly for my application. I have tested it yesterday evening and the valve now stays in its wanted position without the occasional glitch.
In my instance, ECU is short for Engine Control Unit. The engine management system operates the valve (which is located in the exhaust system of the car) when sportmode is manually engaged, or even automatically when certain engine conditions are met. The signal is a ground for as long as the valve needs to stay open. In practice, the signal should not never alternate quickly unless the user (me) is playing with the sport mode button.

About the Eeprom: Well, I read that the eeprom warrants at least 100.000 writes and the valve will probably be operated maybe once or twice per day. That would net a usage of almost 137 years? Even if I use it 10 times a day, theoretically it still would outlast the vehicle :slight_smile:
Another more elegant solution would be to only write the Eeprom on power off (this is how the car's ECU does it), I will look into the BOD trigger function and experiment a bit more.

Thanks for the comments and solution!