I have a piece of code that is started by pressing a push button. Its connected to 5V and uses a 1k pull down resistor. The switch seems to be working erratically. As in some times the button needs to be pressed twice to start the code other times pressing it once will work. Another issue seen is that sometimes once the code starts it will stop before the predetermined amount of time. I have the code attached.The button is designed that if pressed a second time it will terminate the program during a given sequence. Any help or advice would be greatly appreciated. Not from a coding background so any help or advice would be great. I have confirmed with a DMM that my switch is producing the 5V on the output.
1-1_PW4_INT_16_65_F30.ino (2.37 KB)