Change functionality of mechanical switches

Thank you! Coincidentally, I had just come across blink without Delay() during the search for an approach. Implementing it here worked out well! I've been Delay() free now for over 75 minutes.

Also coincidentally, it's a critical precursor for what I need to do next on this project - which is create a speedometer from a reed switch input. (Those buttons increase and decrease the speed of a DC motor.)

The code for this is proving tougher. For a single revolution, the magnet takes a small amount of time to pass the reed sensor, so the input pin reads, not as a single LOW but, as a string of LOWs as it's going past. There's also the bounce of the reed switch adding some misleading HIGHS into those LOWs, and there's a lot of interference here - probably from the dc motor; so, there are more incorrect HIGHs and LOWs scattered throughout. Edge detection, filtering, I'm thinking that I still won't need interrupts since updating the mph display would be in the loop of pressing and holding the speed buttons.

At the highest speed I need to measure with the reed switch (about 1,300 rpm equaling 12mph), a full revolution would take 45 milliseconds. (I wouldn't be able to get a Hall effect Sensor into the setup.) I found that without Serial.printing individual vales, the Arduino can repeat the loop checking the magnet state about 200,000 times a second. That would give me 900 inputs in the span of 45 milliseconds to analyze in order to determine speed. However, when I output through Serial.print for troubleshooting, it will output significantly less than that leaving me looking at a collection of HIGHs and LOWs that isn't definitive.

Since this next issue is no longer related to my mechanical switches, I'll start a new thread somewhere else in the forum.

Now, make that over 80 minutes Delay() free.