NeoPixel's are awesome you can control hundreds, thousands, millions of lights with 3 wires (pwr, signal, gnd). I created this tutorial to provide people with a basic to complex understanding of how to make NeoPixels Rock! I used the fallowing to make mine work: Arduino Uno, 3 wires, and a Neopixel strand. There are only 3-easy steps to make this work!
Step 1: First things first, Install the libraryYou will first need to download the library and install it click here to download the library free. Then copy the folder to your Arduino library folder. (most likely at this path: C:\Program Files (x86)\Arduino\libraries)
The library should be installed now and now you can program the Arduino!
Step 2: Program the ArduinoDownload the Code Here. The code I used is simple once you understand it. You first need to define the strip params:
Adafruit_NeoPixel strip = Adafruit_NeoPixel(COUNT, PIN, NEO_GRB + NEO_KHZ800);
Then start the strip library:
strip.begin();
So you can finally control each pixel color:
uint32_t color = strip.Color(R2, G2, B2);strip.setPixelColor(Pixel, color);strip.show();
In the code section you will find the code I wrote, commented for your easy understanding.
Step 3: Control The LightsOpen your serial port. If you send 'R255G0B0P0' the first led will be red, let me break it down though:
- 'R' stands for red so if you send 'R255' Red will be set to 255
- 'G' stands for green so if you send 'G255' Green will be set to 255
- 'B' stands for blue so if you send 'B255' Blue will be set to 255
- 'P' stands for pixel so when you send that the UNO will write a pixel color for example if you send 'P1' the first pixel will be set to whatever color you have assigned
You can send as many commands at once such as this: 'R100G100B255P0P1P2P3P4P5P6P7P8P9P10
' - this will set pixels 0-10 to Bright Blue. If you send 'S' you will be greeted with a show of Red, Blue, Green, Yellow, Orange, Purple, and Turquoise lights! Watch the video to see.
Simple as that, feel free to try new things with the code it can only help.
Comments