40 Neopixel Shield

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lkhuon1
 
Posts: 1
Joined: Fri Jul 27, 2018 11:35 pm

40 Neopixel Shield

Post by lkhuon1 »

Hello,
I'd purchased Adafruit's 5x8 neopixel shield in hopes of learning about neopixels. I am using it with an Arduino UNO. I've installed all 3 libraries per the Uber guide and attempted to run the examples strandtest and then the matrixtest. While the LEDs do light up for both cases, they do not appear to be correct. I'd search on Youtube and found videos that seem to be much different than what I have. For example, for matrixtest, my shield does not write out 'howdy' but display various colors at various locations. I had originally used an Elegoo UNO clone and thought perhaps this was the issue but since then I have tried the shield on 3 actual Arduino UNOs and get the same results.

I also tried playing with simple commands with just using the Adafruit_Neopixel library as follows.

#include <Adafruit_NeoPixel.h>

#define PIN 6

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

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

void loop() {
//strip.setPixelColor(n, red, green, blue);
strip.setPixelColor(0, 255, 0, 0); //sets 1st pixel to red
strip.setPixelColor(1, 0, 255, 0); //sets 2nd pixel to green
strip.setPixelColor(2, 0, 0, 255); //sets 3rd pixel to blue
strip.show();
}

In the loop(), if I run with only the first and fourth line of code, I get the desired red color on the 1st pixel. If I run all 4 lines, I get almost white on the 1st pixel, off for the 2nd pixel, and green on the 3rd pixel.

Any help would be appreciated. Thanks.

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

Re: 40 Neopixel Shield

Post by adafruit_support_bill »

It sounds like you have one of the RGBW versions of the shield. The example code assumes RBG pixels. You need to specify GRBW when you declare the strip in your code.

Code: Select all

Adafruit_NeoPixel strip= Adafruit_NeoPixel(40, PIN, NEO_GRBW + NEO_KHZ800);

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

Return to “Arduino Shields from Adafruit”