Arduino Library Installation

Controlling NeoPixels “from scratch” is quite a challenge, so we provide a library letting you focus on the fun and interesting bits. The library works with most mainstream Arduino boards and derivatives: Uno, Mega, Leonardo, Micro, Adafruit Flora, etc. — most anything with an Atmel AVR 8-bit processor from 8 to 16 MHz — and also works with the Arduino Due and all varieties of the PJRC Teensy boards.

Because processor-specific assembly language is used, this library does not work on Netduino, ChipKIT or other advanced “Arduino-like” boards. Others may have written code and libraries for such boards, but we’re not able to provide technical support for any bugs or trouble you might encounter there; it’s some real frontier engineering. Some of these alternative libraries are covered in the “Advanced Coding” section.

Install Adafruit_NeoPixel via Library Manager

Recent versions of the Arduino IDE (1.6.2 and later) make library installation super easy via the Library Manager interface. From the Sketch menu, > Include Library > Manage Libraries...  In the text input box type in "NeoPixel". Look for "Adafruit NeoPixel by Adafruit" and select the latest version by clicking on the dropbox menu next to the Install button. Then click on the Install button. After it's installed, you can click the "close" button.

Manually Install Adafruit_NeoPixel Library

If you’re using an older version of the IDE, or just want to set things up manually, “classic” installation of the library is as follows: you can visit the Adafruit_NeoPixel library page at Github and download from there, or just click this button:

  1. Uncompress the ZIP file after it’s finished downloading.
  2. The resulting folder should contain the files Adafruit_NeoPixel.cppAdafruit_NeoPixel.h and an “examples” sub-folder. Sometimes in Windows you’ll get an intermediate-level folder and need to move things around.
  3. Rename the folder (containing the .cpp and .h files) to Adafruit_NeoPixel (with the underscore and everything), and place it alongside your other Arduino libraries, typically in your (home folder)/Documents/Arduino/Libraries folder. Libraries should never be installed in the “Libraries” folder alongside the Arduino application itself…put them in the subdirectory of your home folder.
  4. Re-start the Arduino IDE if it’s currently running.

Here’s a tutorial that walks through the process of correctly installing Arduino libraries manually.

A Simple Code Example: strandtest

Launch the Arduino IDE. From the File menu, select SketchbookLibrariesAdafruit_NeoPixelstrandtest

(If the Adafruit_NeoPixel rollover menu is not present, the library has not been correctly installed, or the IDE needs to be restarted after installation. Check the installation steps above to confirm it’s properly named and located.)

Select your board type and serial port from the Tools menu, and try uploading to the board. If the NeoPixels are connected and powered as previously described, you should see a little light show.

Nothing happens!

Check your connections. The most common mistake is connecting to the output end of a strip rather than the input.

Something happens but the LEDs are blinking in a weird way!

If you are using an RGBW NeoPixel product (look at the LEDs, are they divided 'in half' with a yellow semicircle? you have RGBW Neopixels!)

Change this line:

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


Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_RGBW + NEO_KHZ800);

and reupload the strandtest example.

I don't have RGBW LEDs and the LEDs are still blinking weird!

99% of the time this is due to not having a shared ground wire connected to the Arduino. Make sure the Ground wire from the Neopixels connects to BOTH your power supply ground AND the Arduino ground.

Last updated on 2016-09-25 at 04.44.02 PM Published on 2013-08-30 at 05.06.47 PM