Hi, I have a plan to install a bumper switch in the neck of the robot and just set it up on breadboard to test. I used standard hardware debouncing by using an SN74AC04 hex inverter and 10k resistor and 10mf capacitor and a microswitch.
For test program I attached the zero interrupt of pin 2 and it works, but not well enough: it sometimes makes a mistake. Seems to me not a fast enough debouncing. If I press the switch repeatedly around 2 times a second, it makes mistakes sometimes.
My question: is there any way I could guarantee its operation, or a better way of implementing such a limiting switch, as it is to sit with a dc motor and just imagine if the bot is turning the neck and limiting switch won't work!