I would like to trigger a series of events (that last about 40 seconds) upon the push of a button. The device is running 24/7 for a very long time, so power is a concern.
The Arduino example library provides a debounce code that seems pretty complex for this purpose.
I saw on one forum using a while loop to wait until the button was pushed down and then released again.
// wait until button was pushed down... while (digitalRead(pin) == LOW); // ... and released again while (digitalRead(pin) == HIGH);
is this method acceptable for my purposes?
Do I need any debouncing at all? Or maybe is there a simpler way?