Pages: [1]   Go Down
Author Topic: 2 LPD8806 LED Strips controlled simultaneously  (Read 1015 times)
0 Members and 1 Guest are viewing this topic.
Central Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am kind of a noob when it comes to programming, but i know a little. Can some one help to change this code so that i can control 2 separate strips simultaneously running different variations of the colorWipe() function.

Thank you   




Quote
#include "LPD8806.h"
#include "SPI.h"

// Example to control LPD8806-based RGB LED Modules in a strip

/*****************************************************************************/

// Choose which 2 pins you will use for output.
// Can be any valid output pins.
int dataPin = 2;   
int clockPin = 3;

// Set the first variable to the NUMBER of pixels. 32 = 32 pixels in a row
// The LED strips are 32 LEDs per meter but you can extend/cut the strip
LPD8806 strip = LPD8806(32, dataPin, clockPin);

// you can also use hardware SPI, for ultra fast writes by leaving out the
// data and clock pin arguments. This will 'fix' the pins to the following:
// on Arduino 168/328 thats data = 11, and clock = pin 13
// on Megas thats data = 51, and clock = 52
//LPD8806 strip = LPD8806(32);

void setup() {
  // Start up the LED strip
  strip.begin();

  // Update the strip, to start they are all 'off'
  strip.show();
}


void loop() {

  // fill the entire strip with...
  colorWipe(strip.Color(127,0,0), 10);      // red
  colorWipe(strip.Color(0, 127,0), 10);      // green
  colorWipe(strip.Color(0,0,127), 10);      // blue

}

\

// fill the dots one after the other with said color
// good for testing purposes
void colorWipe(uint32_t c, uint8_t wait) {
  int i;
 
  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why dont you just run clock and data out from one strip into clock and data into the other strip.
So if you first strip has 32 leds, then anything over 32 leds will go into the second strip.
Logged

Pages: [1]   Go Up
Jump to: