Slave serial RoboClaw motor control
-
- Posts: 5
- Joined: Thu Feb 07, 2019 10:44 am
Slave serial RoboClaw motor control
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
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 (119.28 KiB) Viewed 2212 times
-
- 2.PNG (96.78 KiB) Viewed 2212 times
-
- 1.PNG (17.83 KiB) Viewed 2212 times
- Basicmicro Support
- Posts: 1594
- Joined: Thu Feb 26, 2015 9:45 pm
Re: Slave serial RoboClaw motor control
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.
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
Put this in your setup function.