Two Separate 12mm Pixel strips on a single Arduino Board
Moderators: adafruit_support_bill, adafruit

Two Separate 12mm Pixel strips on a single Arduino Board

by joshuakane on Sat May 04, 2013 1:56 pm

I was looking to see if you could power and address two separate AdaFruit WS_2801 12mm Pixel Strips on a single Arduino Uno or Flora controller

I can see that by default you end up addressing the strip in this manner

Adafruit_WS2801 strip = Adafruit_WS2801(LEDS,StripDataPin,StripClockPin);

so my first strip is assigned the name AdaFruit_WS2801, and it gets the values passed in for LEDS, StripDataPin, and StripClockPin

I was thinking with two stips I would have the following variables

Code: Select all | TOGGLE FULL SIZE
#define SLEDS 7
#define HLEDS 20

int power = SLEDS;
int health = HLEDS
//
// LEDS
//
int sStripDataPin  = 10;    // Yellow wire on Adafruit Pixels  strip 1
int sStripClockPin = 9;    // Green wire on Adafruit Pixels strip 1

int hStripDataPin  = 6;    // Yellow wire on Adafruit Pixels Strip 2
int hStripClockPin = 3;    // Green wire on Adafruit Pixels Strip 2

// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
Adafruit_WS2801 strip = Adafruit_WS2801(SLEDS,sStripDataPin,sStripClockPin);
Adafruit_WS2801 strip = Adafruit_WS2801(HLEDS,hStripDataPin,hStripClockPin);



is it possible to overload Adafruit_WS2801 in that way?

Also for the full project I was also going to use an RF Module like the one below so I was thinking I could use the Flora and assign the following buttons via the pins
http://www.adafruit.com/products/1096
and
http://www.adafruit.com/products/1095

D0 (RX) // - Button "A"
D1 (DC) //- Button "C"
D2 (SCA) //- Button "D"

If it is not possible on the Floria I am not opposed to doing the project on an UNO.

Thanks!! :D
User avatar
joshuakane
 
Posts: 174
Joined: Sat Apr 13, 2013 4:40 pm

Re: Two Separate 12mm Pixel strips on a single Arduino Board

by adafruit_support_mike on Sat May 04, 2013 4:57 pm

That should work fine.

The clock and data signals don't consume much power.. only enough to drive the capacitance of the wires and all the input pins in the strip, which probably adds up to a couple of nanofarads. The actual amount of current moving back and forth rounds down to "basically none".

You'll want an external power source for the LED strips of course. That's the piece that supplies all the current.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10133
Joined: Thu Feb 11, 2010 2:51 pm

Re: Two Separate 12mm Pixel strips on a single Arduino Board

by joshuakane on Sun May 05, 2013 4:08 pm

Thanks Mike!

so we are good with the overloading then?

Code: Select all | TOGGLE FULL SIZE
// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
Adafruit_WS2801 strip = Adafruit_WS2801(SLEDS,sStripDataPin,sStripClockPin);
Adafruit_WS2801 strip = Adafruit_WS2801(HLEDS,hStripDataPin,hStripClockPin);
User avatar
joshuakane
 
Posts: 174
Joined: Sat Apr 13, 2013 4:40 pm

Re: Two Separate 12mm Pixel strips on a single Arduino Board

by adafruit_support_mike on Sun May 05, 2013 5:51 pm

The word "overloading" has two specific and important technical meanings:

On the hardware side, it means feeding a component more of something than it's rated to take, or drawing more from it than it's rated to deliver. If an LED's datasheet says you should run it at 25mA but you send 50mA through it, you're overloading the LED. If a power supply is rated to deliver 1A, but you attach devices whose peak demand adds up to 1.5A, you're overloading the power supply.

On the software side, it means creating multiple functions with the same name but different 'signatures':

Code: Select all | TOGGLE FULL SIZE
int doSomething (int parameter_1);
int doSomething (int parameter_1, int parameter_2);
float doSomething (float parameter_3);
float doSomething (float parameter_3, int parameter_2);

That's a set of declarations for an overloaded function.

On the hardware side, overloading is either a Bad Idea or the result of a carefully-made engineering choice. On the software side, overloading is a technique for making general-purpose functions in a strictly typed language.

The code you posted doesn't overload anything in either sense. You're creating two instances of the control object, using different input parameters. That's perfectly okay.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10133
Joined: Thu Feb 11, 2010 2:51 pm