I can upload my sketch to my arduino board but it does nothing

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.

"I dont have the Pwr jumper connected is it because of that?"

You can answer that question by connecting it.

Let’s start again...
We’d love to help, but -

How about posting your schematic?
And using </> code tags.

Next time, read how to post...
It makes helping a lot easier.., time we can spend on someone else.

Hi I am using an arduino UNO board stacked with a motor driver shield l239D and I am trying to only run 4 DC motors however when i put this code none of the motors start working even if i upload another code similar to this.

The code:

/*
Exercise V1 L293D Motor Shield
This simply creates 4 motor objects and then runs them forward, backwards,
stops them and then repeats.
*/
#include <AFMotor.h>

const int MOTOR_1 = 1;
const int MOTOR_2 = 2;
const int MOTOR_3 = 3;
const int MOTOR_4 = 4;

AF_DCMotor motor1(MOTOR_1, MOTOR12_64KHZ); // create motor object, 64KHz pwm
AF_DCMotor motor2(MOTOR_2, MOTOR12_64KHZ); // create motor object, 64KHz pwm
AF_DCMotor motor3(MOTOR_3, MOTOR12_64KHZ); // create motor object, 64KHz pwm
AF_DCMotor motor4(MOTOR_4, MOTOR12_64KHZ); // create motor object, 64KHz pwm
//===============================================================================
// Initialization
//===============================================================================
void setup() {
Serial.begin(9600); // Initialize serial port
Serial.println("Motor test");

motor1.setSpeed(200); // set the motor speed to 0-255
motor2.setSpeed(200);
motor3.setSpeed(200);
motor4.setSpeed(200);
}
//===============================================================================
// Main
//===============================================================================
void loop() {
// Simply run the selected motor in both directions and stop. Then repeat
Serial.println("Forward");

motor1.run(FORWARD); // turn it on going forward
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
delay(3000);

Serial.println("Reverse");
motor1.run(BACKWARD); // the other way
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
delay(3000);

Serial.println("Stop");
motor1.run(RELEASE); // stopped
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
delay(3000);
}

I am using 18650 batteries as the only power source connected to the EXT_PWR

Here is my diagram exept for the infrared sensors and the switch in the batteries for now i just want to move four DC motors. I get no errors in the code and the board even starts bepping.

The diagram:ARDUINO LINE FOLLOWER CAR.jpg - Google Drive

My project: postimg.cc/gallery/2zbioe8nc

Any ideas please?

I've merged your other cross-post @Noslen_noami.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.