Using multiple roboclaws with an Arduino

General discussion of using Roboclaw motor controllers
Post Reply
vch
Posts: 3
Joined: Mon May 31, 2021 12:17 pm
Using multiple roboclaws with an Arduino

Post by vch »

So for a project I am working on I am using two 2x7A motor controllers in conjunction with an Arduino Due. Each roboclaw has two motors on it and I have encoders attached for each motor. I've read the tutorial for the standard serial bus operation with arduino tutorial. With that tutorial, it shows how to just run the motors and I would also like to know the speeds. Is there a way for the roboclaw to send the speed information back to the arduino?

I've used the roboclaw library before in the arduino ide, so I know that there is the ReadSpeedM1 or M2 command. My only concern is that this uses the address of the roboclaw, and since both roboclaws are using the same address this command wouldn't work as intended.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Using multiple roboclaws with an Arduino

Post by Basicmicro Support »

For each Roboclaw you will have a unique class object. That object knows which pins are being used to communciate to the specific Roboclaw. So you can safely use the ReadSpeedM# commands. Since you are using 2 physically different serial ports you can use the same packet address for each roboclaw. You will just be using 2 different roboclaw objects.

Post Reply