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 popup 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

Examples→Adafruit NeoPixel→strandtest

(or, in earlier IDE releases, it’s File→Sketchbook→Libraries→Adafruit_NeoPixel→strandtest).

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(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

to

Adafruit_NeoPixel strip(LED_COUNT, LED_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.

This guide was first published on Aug 30, 2013. It was last updated on Mar 28, 2024.

This page (Arduino Library Installation) was last updated on Mar 08, 2024.

Text editor powered by tinymce.