Hi everyone
So I am using an arduino uno stacked with a motor driver shield l239D and for now I just want to run four DC motors however when i upload the code to my arduino board it does nothing.
My code is correct and the leds on the board blink when i upload the code. I am using 18650 batteries and when I connect them to my shield the green led lights up. I dont have the Pwr jumper connected is it because of that?
I searched a lot and I dont know what to do anymore...
Here is my code:
#include<AFMotor.h>
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);
void setup()
{
motor1.setSpeed(255);
motor2.setSpeed(255);
motor3.setSpeed(255);
motor4.setSpeed(255);
}
void loop()
{
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
delay(5000);
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
}
As for the connections I have everything right i followed this scheme: ARDUINO LINE FOLLOWER CAR.jpg - Google Drive
Exept for the infrared sensors I will put them later and i also didint put that switch in the battery wire for now I just want this simple code to work.
Thanks.