I am using the L298N motor driver for a robotics project to control 4 motors. 2 motors in each input and output terminal. I have this connected to an Arduino Uno which is powered by about 7-8v from NiMH batteries. This battery source also powers a servo with a 470uF capacitor and the L298N board.
I have a strange problem when I use the servo attach method for my servo, only outputs 1 and 2 on the L298N start working meaning the wheels on the left of the robot start moving only. When I have the servo connected and imported the library but don't use the attach method, the L298N outputs to all DC motors meaning it works. Even when I use the servo attach method on a pin where nothing is connected to it, the motors on out 4 and 3 on the L298N don't move. For some reason this attach method is causing issues. Can anyone explain why?
Note: I applied a larger power supply, from my 7V to about 12V but the problem still persists. I don't think power is the issue since the problem even happens when the attach method is called on a pin that has no servo connected to it.