Using 3rd party shields?

Expansion modules and attachments
Post Reply
wtitb
Posts: 32
Joined: Sun Nov 17, 2013 3:32 pm

Using 3rd party shields?

Post by wtitb »

Hi,

I'm from europe, so it's quite expensive to extend my RA controller with additional extensions (shipping + tax). Unfortunately there's no european distributor :(
So I've wondered if one could also use one of the 3rd party shields e.g. an Adafruit 16-channel PWM/Servo Shield.
If so, what are the requirements or specs for a shield to work with the RA?

cheers,
Christian
KRavEN
Posts: 104
Joined: Sun Mar 17, 2013 8:21 am

Re: Using 3rd party shields?

Post by KRavEN »

arduino shields won't work in most instances because they're designed to plug into an arduino and use the various digital or analog pins. If you find breakout boards or modules that are I2C based those should work. You could also do a couple SPI based boards if you use the I2C header and the ATO pins for the slave select pins. All of these would require you to get the appropriate library for the device and update the RA code to work with it.

The adafruit servo breakout board you're specifically asking about uses I2C and is based on the PCA9685 chip. There is some code in the RA PWM library that supports the first 6 channels on that chip. You would need to modify the library to add support for the other 10 channels or create a new library.

I work with this chip myself so I've done some work on a library for it. You can look at my code on github here: https://github.com/brunnels/Libraries/t ... RA_PCA9685

The setSlopeForChannels and setParabolasForChannels uses each bit in an integer as a true or false value to signify what channel is on or off. So to setup parabolas for channel 0 and 15 you would do something like this:

int channels = 0;
channels = ((1 << 0) | (1 << 15));
pca9685.SetParabolasForChannels(channels,0, 80);
wtitb
Posts: 32
Joined: Sun Nov 17, 2013 3:32 pm

Re: Using 3rd party shields?

Post by wtitb »

Hi,

many thanks, sounds great! For the moment 6 channels are more than enough. So, if I get you right, this would work with no other modifications needed?

cheers,
Christian
Post Reply