I2C Motor Driver : I2C Address

Hi,



I’m tryiing to drive 4 DC Motor with I2C Motor Driver 1.3 Module. However, I can not change the I2C Address of Motor Driver.

For using 2 Motor Driver, I’ve changed the address switch (0b1010) of one motor driver and program.

But, I have no response from motor drive.

I tried again to change only the I2C Address (0x0F) in program (but, hardware address is 0x0a) and have response from motor driver.



I don’t understand this problem.

And than, I checked board & circuit and find no part R2 on Board like following picture.
[attachment=0]I2C_Motor.jpg[/attachment]

Can you help to find a way to resolve that ?



Thanks.

Hi there,

I tried and succeeded , there are two suggestions:

1.You need to reset the motor drive after setting the motor drive address.

2.You need to supply two additional motor drives(Extra power supply needs to remove the jumper cap of J4 interface)

As shown below:

The source code is as follows:
[code]/*

  • motor_test.ino
  • Example sketch for Grove - I2C Motor Driver v1.3
  • Copyright © 2012 seeed technology inc.
  • Website : www.seeed.cc
  • Author : Jerry Yip
  • Create Time: 2017-02
  • Change Log :
  • The MIT License (MIT)
  • Permission is hereby granted, free of charge, to any person obtaining a copy
  • of this software and associated documentation files (the “Software”), to deal
  • in the Software without restriction, including without limitation the rights
  • to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  • copies of the Software, and to permit persons to whom the Software is
  • furnished to do so, subject to the following conditions:
  • The above copyright notice and this permission notice shall be included in
  • all copies or substantial portions of the Software.
  • THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  • IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  • FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  • AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  • LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  • OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  • THE SOFTWARE.
    */

#include “Grove_I2C_Motor_Driver.h”

// default I2C address is 0x0f
#define I2C_ADDRESS 0x0f
#define I2C_ADDRESS1 0x0a
char ADDRESS_Flag = 0;
void setup() {
Motor.begin(I2C_ADDRESS);
ADDRESS_Flag = 0;
}

void loop() {
if(ADDRESS_Flag){
Motor.begin(I2C_ADDRESS1);
ADDRESS_Flag = 0;
}
else{
Motor.begin(I2C_ADDRESS);
ADDRESS_Flag = 1;
}
// Set speed of MOTOR1, Clockwise, speed: -100~100
Motor.speed(MOTOR1, 50);
// Set speed of MOTOR2, Anticlockwise
Motor.speed(MOTOR2, -70);
delay(2000);
// Change speed and direction of MOTOR1
Motor.speed(MOTOR1, -100);
// Change speed and direction of MOTOR2
Motor.speed(MOTOR2, 100);
delay(2000);
// Stop MOTOR1 and MOTOR2
Motor.stop(MOTOR1);
Motor.stop(MOTOR2);
delay(2000);
}

// End of file[/code]