One motor isn´t working

Hello,

I bought Arduino nano with L9110 H-bridge module an two DC Motors.
First i try motors on my Arduino Mega.It works well(both motors).
After that i try it on my Arduino nano and there is problem.

On nano works only one Motor.
I change pins(it must be PWM pins) but works only one motor.
In the code isn´t problem because it is working at Mega.
I have it connect like this: IA2 ->D6, IB2 ->D9, IA1 ->D11, IB1 ->D3.

When i switch IA1,IB1 with IA2,IB2 work the second motor and the first isn´t working and conversely.

Please Help.(Sorry for my English)

HiHi,

Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.

http://forum.arduino.cc/index.php/topic,148850.0.html

then look down to item #7 about how to post your code.

It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile:

There is my code:

const int AIA = 14;  // (pwm) pin IA1 
const int AIB = 12;  // (pwm) pin IB2 
const int BIA = 9; // (pwm) pin IA2
const int BIB = 6;  // (pwm) pin IB1 

byte speed = 255;  

void setup() {
  pinMode(AIA, OUTPUT); // set pins to output
  pinMode(AIB, OUTPUT);
  pinMode(BIA, OUTPUT);
  pinMode(BIB, OUTPUT);
}

void loop() {
  forward(); 
  delay(1000);
  backward();
  delay(1000);
  left();
  delay(1000);
  right();
  delay(1000);
}

void backward()
{
  analogWrite(AIA, 0);
  analogWrite(AIB, speed);
  analogWrite(BIA, 0);
  analogWrite(BIB, speed);
}

void forward()
{
  analogWrite(AIA, speed);
  analogWrite(AIB, 0);
  analogWrite(BIA, speed);
  analogWrite(BIB, 0);
}

void left()
{
  analogWrite(AIA, speed);
  analogWrite(AIB, 0);
  analogWrite(BIA, 0);
  analogWrite(BIB, speed);
}

void right()
{
  analogWrite(AIA, 0);
  analogWrite(AIB, speed);
  analogWrite(BIA, speed);
  analogWrite(BIB, 0);
}

HI,
Have you got gnd of Nano and gnd of bridge connected?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks... Tom.. :slight_smile:

Ok.There is my circuit without beadboard : (Sorry for quality)

Might be a good idea to use the same pins in the sketch as you wired up to the Nano... i.e.:

const int AIA = 11; // (pwm) pin IA1
const int AIB = 9; // (pwm) pin IB2
const int BIA = 6; // (pwm) pin IA2
const int BIB = 3; // (pwm) pin IB1

Hey,Thanks.
Im sorry for spaming.
This was my fault (that was the first when i was use nano). :slight_smile: