0

Only first 7 are lighting up on Neopixel Strip
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Only first 7 are lighting up on Neopixel Strip

by AirBubblesCosplay on Thu Sep 12, 2019 3:54 am

Hey everyone! I started a project a few months ago and had to put it aside. I've recently picked it back up again and for some reason only the first 7 of the neopixels in the strip will light up. I've tripled checked the number and I definitely have typed out more than 7 LED's. I'm at a loss.

I'm doing this all through USB as the final project will be run via an external battery/phone charger thing.

And yes, the whole thing worked a few months ago when I was first playing with it.

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define PIN 4
#define N_LEDS 77


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

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 – 500 Ohm resistor on first pixel’s data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit…if you must, connect GND first.

void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code

strip.begin();
strip.show(); // Initialize all pixels to ‘off’
}

void loop() {
int r = 255;
int g = 96;
int b = 12;

for(int x = 0; x <30; x++)
{
int flicker = random(0,40);
int r1 = r-flicker;
int g1 = g-flicker;
int b1 = b-flicker;
if(g1<0) g1=0;
if(r1<0) r1=0;
if(b1<0) b1=0;
strip.setPixelColor(x,r1,g1, b1);
}
strip.show();
delay(random(50,150));
}

AirBubblesCosplay
 
Posts: 61
Joined: Sat Nov 28, 2015 5:02 am

Re: Only first 7 are lighting up on Neopixel Strip

by adafruit_support_bill on Thu Sep 12, 2019 6:12 am

If you place the strip on a flat surface and press down on pixels #6, 7 and 8, do you see any activity on the rest of the strip?

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.