Hello everyone! I have recently started on my first project. I made a tank that is controlled by button presses but values are inputted beforehand, and movement starts with the press of a “Go” button. My tank works, up to 24 button presses, but I realize that my code is horribly inefficient. May someone please inform me of a better way of doing this? Either another example project or a written explanation is fine. Thank you very much! Also does anyone know how to make motor turns more consistent? An issue I have is that on high battery the tank over turns, on low battery the tank under turns, and after continuous turns I think that it is under turning a bit. Any ideas?
Video of tank to understand how it works: Arduino Button controlled tank test - YouTube
The code is as an attachment as it is too long to post in text.
ButtonTankGoodADDINGhelp.ino (37.9 KB)