NeoPixel Cheat Sheet
NeoPixel Cheat Sheet
NeoPixel Cheat Sheet
LED Strips are individually addressable ribbons of RGB (red green blue)
lights, meaning that each light on the ribbon can be controlled by itself
and give o any color on the visible color spectrum. Every light on the
strip has its own chip onboard that processes commands given to it by
the Arduino.
Connecting:
1. Solder wires to the 3 pads on the
LED strip. Make sure they are
soldered at the start of the strip (the
arrows should be going away from
the wires).
2. Connect the +5V on the strip to the
5V pin on the Arduino.
3. Connect the GND on the strip to one
of the GND pins on the Arduino.
4. Connect the DIN (Data IN) on the
strip to any of the digital pins on the
Arduino.
Programming:
This line imports the NeoPixel library to your
Arduino code.
#include <Adafruit_NeoPixel.h>
void setup() {
strip.begin();
strip.show();
}
void loop() {
for (int i = 0; i < strip.numPixels();
i++) {
strip.show();
delay(100);
}
Note: If this is too daunting, or if you need inspiration, open up Arduino and go to File - Examples Neopixel - strandtest. Use that as a starting point.
* 255 may seem like an arbitrary number, but this limit occurs because the computer stores each of the color numbers in 8-bit unsigned (a.k.a. positive only)
numbers. This means that because of the way binary works, the maximum number it can store is 28 or 256, but since computers start counting from 0, 255
becomes the 256th and final number.