# Adafruit NeoPixel Library [![Build Status](https://github.com/adafruit/Adafruit_NeoPixel/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_NeoPixel/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_NeoPixel/html/index.html) Arduino library for controlling single-wire-based LED pixels and strip such as the [Adafruit 60 LED/meter Digital LED strip][strip], the [Adafruit FLORA RGB Smart Pixel][flora], the [Adafruit Breadboard-friendly RGB Smart Pixel][pixel], the [Adafruit NeoPixel Stick][stick], and the [Adafruit NeoPixel Shield][shield]. After downloading, rename folder to 'Adafruit_NeoPixel' and install in Arduino Libraries folder. Restart Arduino IDE, then open File->Sketchbook->Library->Adafruit_NeoPixel->strandtest sketch. Compatibility notes: Port A is not supported on any AVR processors at this time [flora]: http://adafruit.com/products/1060 [strip]: http://adafruit.com/products/1138 [pixel]: http://adafruit.com/products/1312 [stick]: http://adafruit.com/products/1426 [shield]: http://adafruit.com/products/1430 --- ## Installation ### First Method ![image](https://user-images.githubusercontent.com/36513474/68967967-3e37f480-0803-11ea-91d9-601848c306ee.png) 1. In the Arduino IDE, navigate to Sketch > Include Library > Manage Libraries 1. Then the Library Manager will open and you will find a list of libraries that are already installed or ready for installation. 1. Then search for Neopixel strip using the search bar. 1. Click on the text area and then select the specific version and install it. ### Second Method 1. Navigate to the [Releases page](https://github.com/adafruit/Adafruit_NeoPixel/releases). 1. Download the latest release. 1. Extract the zip file 1. In the Arduino IDE, navigate to Sketch > Include Library > Add .ZIP Library ## Features - ### Simple to use Controlling NeoPixels “from scratch” is quite a challenge, so we provide a library letting you focus on the fun and interesting bits. - ### Give back The library is free; you don’t have to pay for anything. Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! - ### Supported Chipsets We have included code for the following chips - sometimes these break for exciting reasons that we can't control in which case please open an issue! - AVR ATmega and ATtiny (any 8-bit) - 8 MHz, 12 MHz and 16 MHz - Teensy 3.x and LC - Arduino Due - Arduino 101 - ATSAMD21 (Arduino Zero/M0 and other SAMD21 boards) @ 48 MHz - ATSAMD51 @ 120 MHz - Adafruit STM32 Feather @ 120 MHz - ESP8266 any speed - ESP32 any speed - Nordic nRF52 (Adafruit Feather nRF52), nRF51 (micro:bit) Check forks for other architectures not listed here! - ### GNU Lesser General Public License Adafruit_NeoPixel is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ## Functions - begin() - updateLength() - updateType() - show() - delay_ns() - setPin() - setPixelColor() - fill() - ColorHSV() - getPixelColor() - setBrightness() - getBrightness() - clear() - gamma32() ## Examples There are many examples implemented in this library. One of the examples is below. You can find other examples [here](https://github.com/adafruit/Adafruit_NeoPixel/tree/master/examples) ### Simple ```Cpp #include #ifdef __AVR__ #include #endif #define PIN 6 #define NUMPIXELS 16 Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); #define DELAYVAL 500 void setup() { #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif pixels.begin(); } void loop() { pixels.clear(); for(int i=0; i