Can't drive long NeoPixel strips with Due or Duemilanove? I spent a significant part of today developing a sprite movement library for a 30-pixel NeoPixel strip using my Arduino Duemilanove (ATmega 168). It works like a charm. However, if I change N_LEDS to a significantly higher value, the program seems not to run. I can't get it to run on the Duemilanove for a strip of longer than 50.

In fact, (see the below code) a relatively high N_LEDS value won't even allow the test patterns to run as defined in setup(). This leads me to believe that inexplicably the constructor for Adafruit_Neopixel is failing.

A friend of mine (who has the ultimate application for this) is hoping to drive a strand of 750 LEDs using this code on an Arduino Due. I can't imagine memory would be an issue with the Due, so what's going on here? 

Headers:

#include &lt;Adafruit_NeoPixel.h&gt;

#define PIN    6
#define N_LEDS 30      // &lt;-- If this number is &gt; ~50, nothing happens
#define MAXSPRITES 5
#define MIN_UPDATE_INTERVAL_IN_MS  15
#define MAX_UPDATE_INTERVAL_IN_MS  40
#define SENSOR_TIMEOUT_IN_MS  2000
#define SCANNER_WIDTH  9


Strip declaration:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);


setup() and loop():

void setup() {
    randomSeed(analogRead(0));  

    strip.begin();

    darkenStrip();

    manager = new SpriteManager();
    manager-&gt;Add(new TestPatternSprite(0, 0xff0000));
    manager-&gt;Add(new TestPatternSprite(5, 0x00ff00));
    manager-&gt;Add(new TestPatternSprite(10, 0x0000ff));
}

loop() {
    ...
}


Are there any coding mistakes in the above that wouldn't allow us to run this code on the Due? Or is this a known limitation?
Your Duemilanove only has 1k of RAM. That's not much. Each pixel takes 3 bytes of RAM (R/G/B). So (say) 60 pixels would be 180 bytes. That's less than 1k, but there would be other uses of RAM in your sketch. 

750 LEDs sounds like pushing it for the low-RAM Arduinos.

You might want to look at NeoPixels Revealed: How to (not need to) generate precisely timed signals The author managed to drive over 1000 NeoPixels with a Duemilanove.

I'm not sure if that applies to your exact type of NeoPixels, but it is worth considering.