I am seeking help with a project I am attempting and have run into an issue I've had trouble finding an answer for. What I am trying to do is have six push buttons that activate a different loop of code when each button is pushed.
I have wired my push buttons to a single input recognizing which button is pressed depending on the resistance value returned as instructed in this guide https://www.the-diy-life.com/multiple-push-buttons-on-one-arduino-input/
That's all good and functioning. The issue that I'm having is that when I push one of the buttons the analog read function stops while that if loop is in progress and I cannot activate any of the other loops until that loop has finished. What I need to do is have them be executable simultaneously. Is this something that is possible to do?
Here's my code: https://pastebin.com/py3uxnFT
Any help or just a simple point in the right direction would be greatly appreciated. Thank you for reading.