12055Views11Replies

Author Options:

Programming Adafruit NEOPIXELS? Answered

I would like to know where I can find commands for the Neopixels sold by Adafruit.  More specifically command to just turn the pixels on solid.... no blinking, no chase, etc.... just on solid with the ability to tweak the color via the program (or analog pots, one for each color would be great too).?

13 Replies

user
steveastroukBest Answer (author)2014-02-18

There are loads of libraries for these things. Basically all you do is stuff RGB bytes into a big array, then the library clocks the data out for you, so, for example, for three led strip (RGB,RGB,RGB), you'd write (0xFF,0,0,0xFF,0,0,0xFF,0,0) to the LEDs to get solid red.

Select as Best AnswerUndo Best Answer

user
Cactopus (author)2015-12-07

I want to find out how to do this too. I've read through the whole neopixel Uberguide, and very closely studied the library examples for neopixels, but I can't find the one thing that will make it all make sense to a person that hasn't done Arduino before: a reference for the definitions of the terms used in the library! I mean how are we supposed to just intuitively know what all these commands do:

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);

so strip.setPixelColor(i, c); is probably "this pixel this color"

There is no glossary of what exactly all these arguments do. There are very short comments in the code about them, but that is insufficient for most people that are new to Arduino, I would imagine. The comments in the code is written for people that have already been programming Arduino code for several years and is fluent in how it all works.

Select as Best AnswerUndo Best Answer

user
Kelton444 (author)Cactopus2015-12-19

I'm totally with you! It assumes too much prior programming knowledge for a beginner, and the comments are not detailed enough. I've been slowly piecing it all together by googling each term. What a pain.

Select as Best AnswerUndo Best Answer

user
JM1999 (author)2014-02-17

Have you tried contacting Adafruit?

Select as Best AnswerUndo Best Answer

user
FarmerKJS (author)JM19992014-07-07

yes and they recomened to use more expensive things than what is needed

Select as Best AnswerUndo Best Answer

user
JM1999 (author)FarmerKJS2014-07-09

Yeah, I guess they want to sell their stuff so they would want you to buy the more expensive piece of equipment.

Looks like you have it figured out though so have fun!

Select as Best AnswerUndo Best Answer

user
Jayefuu (author)2014-02-18

Did you not read the tutorial? The Adafruit website is the best resource for reading about their products, they've got many in depth guides on how to use Neopixels.

Select as Best AnswerUndo Best Answer

user
Antikythera (author)Jayefuu2014-07-03

https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)Jayefuu2014-02-18

I know they look great on a UHT.

Select as Best AnswerUndo Best Answer

user
Jayefuu (author)steveastrouk2014-02-18

Nice! I bought a strip to play with too. Need to find a suitable power supply for the whole lot though.

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)Jayefuu2014-02-18

Just commissioned a new one with the display and hermetically sealed door - its running on pure carbon monoxide inside this one.

Select as Best AnswerUndo Best Answer

user
FarmerKJS (author)Jayefuu2014-02-18

here is a list of everything you need to get started

NEOPIXEL Strip

controller i use gema for testing

power supply

i am using some big industial psu's for a project that i am doing i am putting tons of neopixels in crown molding in our den look forward for an instruckable soon!

Select as Best AnswerUndo Best Answer

user
Antikythera (author)2014-07-03

It's in the Strand test example.

void setup() {

pinMode(0, OUTPUT); // pin0 to + of led (- to ground)

digitalWrite(0,HIGH);

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

it has been a few months but maybe this will help anyone with a similar question.

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);

so strip.setPixelColor(i, c); is probably "this pixel this color"

Select as Best AnswerUndo Best Answer