Lots of NeoPixels

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
joshstern
 
Posts: 42
Joined: Wed May 28, 2014 4:28 pm

Lots of NeoPixels

Post by joshstern »

Hi all,

I'm taking some NeoPixel strip and lining it on some stairs but I'm running in to some snags. I have everything wired properly but the NeoPixel strip fails to light up.

I have 248 Pixels in the strip but it won't light up unless I tell the sketch that it's only 110 Pixels. Anything more than that, the strip fails to load. I have the strip, with Flora (I've tried Gemma too) connected to an Apple iPad wall adapter.

Any ideas? Do I need more power?

Thanks!
Josh

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: Lots of NeoPixels

Post by Franklin97355 »

Could you post your code and a description or drawing of your connections between it all? Please use the code button "</>" or

Code: Select all

 tags when posting code to the forums. Also you may want to look over this on [url=https://learn.adafruit.com/memories-of-an-arduino]Arduino memory management[/url] as you may be running out of memory.

User avatar
joshstern
 
Posts: 42
Joined: Wed May 28, 2014 4:28 pm

Re: Lots of NeoPixels

Post by joshstern »

The code is merely the StrandTest with the correct number of Pixels:

Code: Select all

#include <Adafruit_NeoPixel.h>

#define PIN 6

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(248, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  // Some example procedures showing how to display to the pixels:
  colorWipe(strip.Color(255, 0, 0), 50); // Red
  colorWipe(strip.Color(0, 255, 0), 50); // Green
  colorWipe(strip.Color(0, 0, 255), 50); // Blue
  rainbow(20);
  rainbowCycle(20);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}
Layout.png
Layout.png (195.34 KiB) Viewed 229 times

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: Lots of NeoPixels

Post by adafruit_support_bill »

I have the strip, with Flora (I've tried Gemma too) connected to an Apple iPad wall adapter.
I'd suspect a power problem. 248 pixels could pull as much as 15 amps at max intensity. Running StrandTest probably requires about 1/2 to 1/3 of that. Still probably more than your wall adapter is capable of supplying.

Running out of SRAM is another possibility. (Definitely too many pixels for a Gemma) The tutorial link posted by Franklin has some advice on diagnosing memory problems.

User avatar
chemdoc77
 
Posts: 148
Joined: Mon Jan 28, 2013 9:32 am

Re: Lots of NeoPixels

Post by chemdoc77 »

Hi Josh:
You might be able to find out if your problem is a power problem by changing the loop in your sketch to a lower brightness like this:

Code: Select all

void loop() {
  // Some example procedures showing how to display to the pixels:
  colorWipe(strip.Color(15, 0, 0), 50); // Red
  colorWipe(strip.Color(0, 15, 0), 50); // Green
  colorWipe(strip.Color(0, 0, 15), 50); // Blue
  //rainbow(20);
  //rainbowCycle(20);
}
If it runs all of the pixels then you have a power problem.

Did you check that you have 5 volts at the end of the strip?

Recently, I had a SRAM problem when a sketch that ran on a Uno would not run on a Trinket. I am in the process of trying to lower the SRAM amount in that sketch so that it will run on a Trinket.

Best Regards,
Chemdoc77

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”