BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Sun Jun 26, 2022 12:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Roboclaw Custom Library for Arduino Mega
PostPosted: Tue Mar 05, 2013 4:59 pm 
Offline
Citizen

Joined: Wed Aug 01, 2012 4:15 pm
Posts: 6
Attached is a custom library I modified for use of multiple roboclaws on one Serial line with the Arduino Mega. The setup for a roboclaw is:
Code:
Roboclaw2 roboclawA(19,18,1);


where 19 and 18 are the TX and RX pins for Serial1 and the 1 designates which Hardware Serial is being used. Currently I'm running 6 roboclaws (12 motors) on Serial1 without any problems - am able to read data from the encoders!

Feel free to use and modify as needed!


Attachments:
RoboClaw2.zip [3.96 KiB]
Downloaded 843 times
Top
 Profile  
 
 Post subject: Re: Roboclaw Custom Library for Arduino Mega
PostPosted: Tue Mar 05, 2013 6:35 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
Thanks for posting this. Im sure our Mega users will appriciate it.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Roboclaw Custom Library for Arduino Mega
PostPosted: Tue Mar 05, 2013 9:22 pm 
Offline
New User

Joined: Fri Jan 04, 2013 10:57 pm
Posts: 4
Are you able to parallel connect all the roboclaw serial lines? I found I had to put low drop diodes on the mega's rx line to each roboclaw. Also, I recently posted a similar library (but with a hardcoded hardware serial) that fixed some of the functions that basic micro posted. I have been meaning to make it a bit better, and post it to the arduino playground.


Top
 Profile  
 
 Post subject: Re: Roboclaw Custom Library for Arduino Mega
PostPosted: Thu Mar 07, 2013 3:21 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
To connect multiple roboclaw TX pins(the S2 pin) back to a single pin on any processor you will need to add a diode(IN4148 or similar) from the roboclaw pin back to a common pin. Then a single pullup(or use an internal pullup on your processor) on the common pin to create a bus.

This will allow you to talk and receive data back from multiple roboclaws on the same I/O.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO