I recently got an L298N module so that I could run motors easier for a small RC car I am planning on building. The problem is that I can't get the motors to run smoothly. They just whine and move a little bit but not the speed I tell them to. I know the motors work, and I am pretty sure my L298N and arduino work properly, and I am not sure what to do. They are 0.5v to 6v motors and I'm not sure if there is something wrong with the voltage being delivered to the motors.
Circuit:
Code:
void setup() {
// put your setup code here, to run once:
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(8, HIGH);
digitalWrite(7, LOW);
analogWrite(9, 180);
delay(2000);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
analogWrite(9, 180);
delay(2000);
}
Any help and criticism are appreciated, thanks!