Only two of four motors working on Keyestudio 4wd BT Car V2.0

When i upload the keyestudio 4wd BT Car V2.0 lesson 8 motor driver shield, Tt's uploaded successfully but just M1 and M2 motors are ruining M3 and M4 motors are not working i tried to change the jumblers but same result, if you can help
Thanks A lot.

/*
 keyestudio 4wd BT Car V2.0
 lesson 8
 motor driver shield
 http://www.keyestudio.com
*/ 
#define ML_Ctrl 4     // define the direction control pin of B motor
#define ML_PWM 5   //define the PWM control pin of B motor
#define MR_Ctrl 2    //define direction control pin of A motor
#define MR_PWM 9   //define the PWM control pin of A motor
void setup()
{
  pinMode(ML_Ctrl, OUTPUT);//define direction control pin of B motor as output
  pinMode(ML_PWM, OUTPUT);//define PWM control pin of B motor as output
  pinMode(MR_Ctrl, OUTPUT);//define direction control pin of A motor as output.
  pinMode(MR_PWM, OUTPUT);//define the PWM control pin of A motor as output
}
void loop()
{ 
  digitalWrite(ML_Ctrl,HIGH);//set the direction control pin of B motor to HIGH
  analogWrite(ML_PWM,200);//set the PWM control speed of B motor to 200
  digitalWrite(MR_Ctrl,HIGH);//set the direction control pin of A motor to HIGH
  analogWrite(MR_PWM,200);//set the PWM control speed of A motor to 200

  //front
  delay(2000);//delay in 2s
  digitalWrite(ML_Ctrl,LOW);//set the direction control pin of B motor to LOW

  analogWrite(ML_PWM,200);//set the PWM control speed of B motor to 200  
  digitalWrite(MR_Ctrl,LOW);//set the direction control pin of A motor to LOW
  analogWrite(MR_PWM,200);//set the PWM control speed of A motor to 200
   //back
  delay(2000);//delay in 2s 
  digitalWrite(ML_Ctrl,LOW);//set the direction control pin of B motor to LOW
  analogWrite(ML_PWM,200);//set the PWM control speed of B motor to 200
  digitalWrite(MR_Ctrl,HIGH);//set the direction control pin of A motor to HIGH
  analogWrite(MR_PWM,200);// set the PWM control speed of A motor to 200

    //left
  delay(2000);//delay in 2s
  digitalWrite(ML_Ctrl,HIGH);//set the direction control pin of B motor to HIGH
  analogWrite(ML_PWM,200);//set the PWM control speed of B motor to 200
  digitalWrite(MR_Ctrl,LOW);// set the direction control pin of A motor to LOW
  analogWrite(MR_PWM,200);//set the PWM control speed of A motor to 200

   //right
  delay(2000);//delay in 2s
  analogWrite(ML_PWM,0);//set the PWM control speed of B motor to 0
  analogWrite(MR_PWM,0);//set the PWM control speed of A motor to 0

    //stop
  delay(2000);//delay in 2s
}//*************************************************************************

Do you have a schematic to upload here for viewing?

Also, show a good picture of your wiring.

I see the code is only writing to two motors (R and L).

Your code works. Start both motors. Left turn. Right turn. Stop.

The message that appears at the end of your post,
( Avrdude: skt500...........),
means that your code was not loaded on Arduino.

Correct this problem and maybe everything will work correctly after loading your code.

It seems that you only enable 2 engines.
Are the motors connected in parallel?
See more information about this type of project at:

https://docs.keyestudio.com/projects/KS0470/en/latest/KS0470-Arduino.html

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.