I’m looking for some help with my code I have for this project: My goal is to have a push button activate a relay board (5v activation, 250v 10A relay). When the button is pressed relay 1 should go on for a split second, and then the program will wait for the button to be pressed again and then relay 2 will go on for a second. Next time the button is pressed it should go back to relay 1.
I currently have a code that works but it has glitches, sometimes it switches between relay 1 and relay 2 as it should but sometimes it will do the relays out of order, for example it could be going:
relay 1,2,1,2,1,1,1,2,2,1. It just seems to be random.
Not sure what is wrong but if anyone could lend a hand I’d appreciate it.
mp3_trigg_test.ino (996 Bytes)