Problems with LED strip

http://www.ebay.com/itm/5M-x-48-LED-m-RGB-Strip-LPD8806-T1000S-Controller-WOW-FAST-USA-SHIP-/170995400277?pt=LH_DefaultDomain_0&hash=item27d01ebe55

I purchased one of these and have been having problems getting it to behave on my Uno. I purchased it with the controller listed in the auction so I could test it and make sure it was my code and not the strip. The demo displays that come with the controller box light everything up fine.

Even a basic sample like this just lights all of the LED's up as white:

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

int nLEDs = 240;

int dataPin = 2;
int clockPin = 3;

LPD8806 strip = LPD8806(nLEDs, dataPin, clockPin);

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

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

void loop() {
colorChase(strip.Color(127, 0, 0), 100); // Red
colorChase(strip.Color( 0,127, 0), 100); // Green
colorChase(strip.Color( 0, 0,127), 100); // Blue
colorChase(strip.Color(127,127,127), 100); // White
}

// Chase one dot down the full strip. Good for testing purposes.
void colorChase(uint32_t c, uint8_t wait) {
int i;

// Start by turning all pixels off:
for(i=0; i<strip.numPixels(); i++) strip.setPixelColor(i, 0);

// Then display one pixel at a time:
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c); // Set new pixel 'on'
strip.show(); // Refresh LED states
strip.setPixelColor(i, 0); // Erase pixel, but don't refresh!
delay(wait);
}

strip.show(); // Refresh to turn off last pixel
}

Any ideas?

Thanks
dave

a) Please post your code between the # tag. You can first enter your code, highlight it all, and click on the # icon.
b) How did you connect the string to your Arduino? It should have several wires (probably four).
c) Alternatively, try running the strip via SPI by using FastSPI (Google Code Archive - Long-term storage for Google Code Project Hosting.) - it's much faster than bit-banging.

There are four wires, positive, negative, clock, and data. I'm using the same power supply in both cases. Data is hooked to pin 2 and clock is hooked to pin 3.

I can try the other library also.

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

int nLEDs = 240;

int dataPin  = 2;
int clockPin = 3;

LPD8806 strip = LPD8806(nLEDs, dataPin, clockPin);

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

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

void loop() {
  colorChase(strip.Color(127,  0,  0), 100); // Red
  colorChase(strip.Color(  0,127,  0), 100); // Green
  colorChase(strip.Color(  0,  0,127), 100); // Blue
  colorChase(strip.Color(127,127,127), 100); // White
}

// Chase one dot down the full strip.  Good for testing purposes.
void colorChase(uint32_t c, uint8_t wait) {
  int i;
  
  // Start by turning all pixels off:
  for(i=0; i<strip.numPixels(); i++) strip.setPixelColor(i, 0);

  // Then display one pixel at a time:
  for(i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c); // Set new pixel 'on'
    strip.show();              // Refresh LED states
    strip.setPixelColor(i, 0); // Erase pixel, but don't refresh!
    delay(wait);
  }

  strip.show(); // Refresh to turn off last pixel
}

Make sure you're reading the clock and data wires correctly. Some of those strips aren't labeled very well. You can also just swap them around and see what happens, it won't damage the strip.

I've tried it flipping data and clock both directions. I also grabbed the fastspi library and attempted that also with the same results.

Can you post the code you're using with the FastSPI library? I'm not familiar with the other library you're using, so my apologies for that.

This is what I tested with:

#include <FastSPI_LED.h>

#define NUM_LEDS 240

// Sometimes chipsets wire in a backwards sort of way
struct CRGB { unsigned char b; unsigned char r; unsigned char g; };
// struct CRGB { unsigned char r; unsigned char g; unsigned char b; };
struct CRGB *leds;

#define PIN 4

void setup()
{
  FastSPI_LED.setLeds(NUM_LEDS);
  FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD8806);
  //FastSPI_LED.setChipset(CFastSPI_LED::SPI_SM16716);
  //FastSPI_LED.setChipset(CFastSPI_LED::SPI_TM1809);
  //FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD6803);
  //FastSPI_LED.setChipset(CFastSPI_LED::SPI_HL1606);
  //FastSPI_LED.setChipset(CFastSPI_LED::SPI_595);
  //FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2801);

  FastSPI_LED.setPin(PIN);
  
  FastSPI_LED.init();
  FastSPI_LED.start();

  leds = (struct CRGB*)FastSPI_LED.getRGBData(); 
}

void loop() { 
  // one at a time
  for(int j = 0; j < 3; j++) { 
    for(int i = 0 ; i < NUM_LEDS; i++ ) {
      memset(leds, 0, NUM_LEDS * 3);
      switch(j) { 
        case 0: leds[i].r = 255; break;
        case 1: leds[i].g = 255; break;
        case 2: leds[i].b = 255; break;
      }
      FastSPI_LED.show();
      delay(10);
    }
  }

  // growing/receeding bars
  for(int j = 0; j < 3; j++) { 
    memset(leds, 0, NUM_LEDS * 3);
    for(int i = 0 ; i < NUM_LEDS; i++ ) {
      switch(j) { 
        case 0: leds[i].r = 255; break;
        case 1: leds[i].g = 255; break;
        case 2: leds[i].b = 255; break;
      }
      FastSPI_LED.show();
      delay(10);
    }
    for(int i = NUM_LEDS-1 ; i >= 0; i-- ) {
      switch(j) { 
        case 0: leds[i].r = 0; break;
        case 1: leds[i].g = 0; break;
        case 2: leds[i].b = 0; break;
      }
      FastSPI_LED.show();
      delay(1);
    }
  }
  
  // Fade in/fade out
  for(int j = 0; j < 3; j++ ) { 
    memset(leds, 0, NUM_LEDS * 3);
    for(int k = 0; k < 256; k++) { 
      for(int i = 0; i < NUM_LEDS; i++ ) {
        switch(j) { 
          case 0: leds[i].r = k; break;
          case 1: leds[i].g = k; break;
          case 2: leds[i].b = k; break;
        }
      }
      FastSPI_LED.show();
      delay(3);
    }
    for(int k = 255; k >= 0; k--) { 
      for(int i = 0; i < NUM_LEDS; i++ ) {
        switch(j) { 
          case 0: leds[i].r = k; break;
          case 1: leds[i].g = k; break;
          case 2: leds[i].b = k; break;
        }
      }
      FastSPI_LED.show();
      delay(3);
    }
  }
}

Ok, with that many LEDs, how are you powering them? At the very least the 'one at a time' routine should run, the rest will likely not run due to current requirements.

Also need to see how you have them wired up. Which pins, which wires, etc., etc. Schematic and picture helps.

Digital RGB LED Weatherproof Strip 32 LED - (1m) LPD8806

My problem ended up being a missing ground. The undo was powered from the USB and the strip from another supply after putting a jumper between the two grounds it worked fine. Thanks for the help!