Problems with the Adafruit NeoPixel Shield for Arduino - 40 RGB LED Pixel Matrix

Hello friends, I am having problems implementing this code in Adafruit NeoPixel Shield for Arduino - 40 RGB LED Pixel Matrix, it runs normal for a few minutes and then crashes. Here is the code below:

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

#define LED_PIN 6
#define LED_COUNT 40
#define LED_BRIGHTNESS 5

Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
int t;
void setup() {
  // These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
  // Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif
  // END of Trinket-specific code.
  strip.begin();
  strip.show();
  strip.clear();
  strip.setBrightness(LED_BRIGHTNESS);
}

void loop() {
  t++;
  for (int i = 0; i < LED_COUNT; i++) {
    int cng = LED_COUNT / 2 + cos(i * 0.5 + t) * LED_COUNT / 2;
    if (cng > LED_COUNT / 10) {
      strip.setPixelColor(i, strip.Color(255, sin(t)*255, 0));
    }
    if (cng > LED_COUNT / 5) {
      strip.setPixelColor(i, strip.Color(0, 255, 0));
    }
    if (cng > LED_COUNT / 2) {
      strip.setPixelColor(i, strip.Color(0, 0, 255));
    }
  }
  strip.show();
  delay(50);
}

Here in the video the moment it crashed and I press the reset button and it works again for a few minutes

They say:

To make it easy to start, the LEDs are by default powered from the 5V onboard Arduino supply. As long as you aren't lighting up all the pixels full power white that should be fine. If you want to power the shield with an external power supply, solder in the included terminal block (pro-tip: put it on the bottom of the board so it doesn't stick up) to wire in an external 4-6VDC power supply

So how are you powering/ lighting it? In spite of what they say, 40 LEDs is a lot to be powering from the Arduino alone.

Also you never said what Arduino you're using.

In this one I am using the Arduino Uno and using the arduino's power supply through the usb

As I suggested, that isn't really an adequate power supply. Follow the Adafruit instructions to add an external 5V supply to satisfy the LED current demands.

If you feel the on board regulator, you will probably find that it is hot enough to burn your fingers.

Thanks buddy, I will try it this way.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.