Slave serial RoboClaw motor control

General discussion of using Roboclaw motor controllers
Eoghan Killalea
Posts: 2
Joined: Thu Feb 07, 2019 10:44 am

Slave serial RoboClaw motor control

Postby Eoghan Killalea » Thu Feb 07, 2019 10:54 am

Hi, just wondering if anyone could help me, I am trying to control two motors using 2 RoboClaw Solo 30A Motor Controllers, using simple serial and a slave select.

I am using Arduino Uno and have a very simple code which is attached. Also I have attached my layout of my hardware. There is also a screenshot of my Basic Micro Studio screen.

The code seems to ignore the pins 5 and 6 completely, and procededs to turn both motors in the same fashion. I am wondering why this is happening.

Thanks, Eoghan
Attachments
3.PNG
3.PNG (119.28 KiB) Viewed 168 times
1.PNG
1.PNG (17.83 KiB) Viewed 168 times
2.PNG
2.PNG (96.78 KiB) Viewed 168 times

User avatar
Basicmicro Support
Posts: 1135
Joined: Thu Feb 26, 2015 9:45 pm

Re: Slave serial RoboClaw motor control

Postby Basicmicro Support » Fri Feb 08, 2019 10:38 am

Your program doesnt set P5 or P6 as outputs as far as I can tell. These pin defualt as inputs. Using the write command on inputs wont do anything to them. You need to use a pinMode function to set the pins as outputs:

pinMode(5, OUTPUT);
pinMode(6, OUTPUT);

Put this in your setup function.


Return to “General Discussion”

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron