2 motors operating with one line


#1

I have an issue in my robot that when I write a simple program as followin
#include “MeOrion.h”
#include <Wire.h>
#include <SoftwareSerial.h>

MeEncoderNew motor1(0x09, SLOT1);   //  Motor at slot1

void setup()
{
  motor1.begin();
  Serial.begin(9600);
}

void loop()
{
  motor1.moveTo(360, 200);
  delay(2000);
  motor1.moveTo(0, 100);
  delay(2000);
}

the robot moves tow motors together and in the program I have commanded one only to move ?


#2

Hi ShehabAldeen,

Which mainboard do you use? Do you connect two encoder motors to the mainboard? And on each driver, there is an encoder motor driver connected to the port slot 1?


#3

I am using orion and I am cnnecting two high power encoder motor drivers to the orion and 4 motors are connected when I upload this program 2 motors are moving


#4

In this case, it is normal that two motors which connected to slot 1 on both driver will operate.
Since the two encoder motor drivers use the same I2C address 0x09 by default.

If you want to drive each motor separately, you need change the I2C address of one of the high power encoder motor drivers. Here is a post include the instruction of changing I2C address of the driver.


#5