I have been working on a project that uses 800khz timing sensitive RGB LEDs. Adafruit Neo Pixels to be exact.
This is also my first attempt with Arduino and programming in general.
Not knowing that interrupts can effect code timing, i programmed to use. With goofy things going on I then learned about debounce. All is well, and i build a hardware switch debouncer, using 7414 with 10k pullup and cap to ground so pin1 high pin2 low and if switch hit pulls down pin one and pin2 goes high. I tried in project and well it worked very well. I thought I was golden.
Nope. It seems OK if switch presses are spread out in time, nothing bad seems to happen. But a couple very quick "double tap" type presses of switch seems to get timing out enough that more weirdness happens. the programmable LED will seize lights will be wrong color and such. sometimes program seems to recover on its own, sometimes if i press the switch again,program will recover and worse case have to cycle power to get running again.
I went the way of the interrupt as all my project does is different light patterns, but if switch is hit using switch case break it jumps to a random light pattern.
The constant polling (switch press importance) is paramount, it is why I went with interrupt. Is there anything else I can use or try. either hardware or software.
I am going to put scope on output of 7414 pin two and see if i see any weirdness in the mean time.
Thanks Chris