Help me about my car leftback motor doesnt workıng

İm trying to make an ir controlled car
its work but the leftback motor is not working
im sure about the code and the connections in another code its working but with out ir controll
where is the problem?

Here is my code:

#include <AFMotor.h>
#include <IRremote.h>

AF_DCMotor motor1(1, MOTOR12_1KHZ);
AF_DCMotor motor2(2, MOTOR12_1KHZ);
AF_DCMotor motor3(3, MOTOR34_1KHZ);
AF_DCMotor motor4(4, MOTOR34_1KHZ);
IRrecv IR(A5);
decode_results result;

int Speed = 250;

#define up 16718055
#define down 16730805
#define left 16716015
#define right 16734885
#define Stop 16726215

void setup() {
Serial.begin(9600);
motor1.setSpeed(250);
motor2.setSpeed(250);
motor3.setSpeed(250);
motor4.setSpeed(250);
IR.enableIRIn();

}

void loop() {
if (IR.decode(&result)) {
Serial.println(result.value);
IR.resume();
}
delay(100);
if (result.value == up ) {
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
} else if (result.value == down ) {
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
} else if (result.value == Stop) {
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
} else if (result.value == left) {
motor1.run(FORWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(BACKWARD);
} else if (result.value == right) {
motor1.run(BACKWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(FORWARD);
}
}

Did you get a warning pop-up when you posted your code without using code tags ?

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Your post was MOVED to its current location as it is more suitable.

no?

no ??? What ?

Hi
No?
Oh my God............

Now a question:

If motor1-2 is on the left then motor3-4 is on the right, but if motor1-2 is on the right then motor3-4 is on the left.

I'm right so far....

You are right if I am facing you.

I imagine it means "no, I didn't get a warning pop-up"

Hi
thanks for your attention.
I also think I answered the reason for the no, but I didn't understand was the ? after the no.
Att:

I interpreted the "no?" as "no, should I have done ?"

Hi
truth
Att:

i didnt get any warning
and the leftback motor is 2 the left side is 1 and 2 so you are wrong

What about this test? Disconnect the working motor and see if the other wakes up?
Schematics could be useful. Power issues often causes problems like Yours.

OKAY ill try it when the car get charge

didnt work

Okey.
If I would be facing this issue I would make a test sketch, cutting away all other code than just the motor control.
In loop exercise each motor, one at the time, then the motor combinations You need like 2 at the same time, or even all 4.

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