I am trying to run two dc motors off an Arduino connected to an L298N. I’m using pushbuttons wired to the analog pins with resistors to control the direction of each motor. I have the Arduino wired to my computer and the L298N powered by a 12v battery supply.
My issue is that only one motor is working and only in one direction. Meaning only one button is working on that motor, and neither button works on the other motor. I know the correct voltage values are getting back to the analog pins because I have the serial monitor reading me those values. I also know that both motors are fully functional through other testing. Am I not using a big enough power supply? And if so, why is only one motor running in one direction? Or is my code incorrect? I have attached a picture of my setup and the code I am using.
TwoPins.ino (1.79 KB)