I have two Grove Motor Drivers (1.3b), one set to address 0x0F and the other 0x0A, per the instructions on the Wiki. I cannot seem to address them individually. In fact, I’m starting to think that the only address the driver listens to is 0xF. Has anyone successfully ran two of these on the same bus? If so, what addresses did you use?
This code will drive the back motors fine, but the front board doesn’t do anything. If I flip the address around in code (and change the address on the board), the front board will drive its motors.
[code]
#include “Grove_I2C_Motor_Driver.h”
#define FRONT_ADDR 0x0A
#define BACK_ADDR 0x0F
I2CMotorDriver FrontMotors;
I2CMotorDriver BackMotors;
void setup() {
Serial.begin(9600);
Serial.println(“Motor Test”);
FrontMotors.begin(FRONT_ADDR);
BackMotors.begin(BACK_ADDR);
}
void loop() {
FrontMotors.stop(MOTOR1);
FrontMotors.stop(MOTOR2);
BackMotors.stop(MOTOR1);
BackMotors.stop(MOTOR2);
Serial.println(“Front RIGHT”);
FrontMotors.speed(MOTOR1, 50);
delay(2000);
FrontMotors.stop(MOTOR1);
delay(2000);
Serial.println(“Front LEFT”);
FrontMotors.speed(MOTOR2, 50);
delay(2000);
FrontMotors.stop(MOTOR2);
delay(2000);
Serial.println(“Back RIGHT”);
BackMotors.speed(MOTOR1, 50);
delay(2000);
BackMotors.stop(MOTOR1);
delay(2000);
Serial.println(“Back LEFT”);
BackMotors.speed(MOTOR2, 50);
delay(2000);
BackMotors.stop(MOTOR2);
delay(2000);
}
[/code]