There are some pros and cons to driving the strips this way…
Pro: Very simple, easy and fast. Use any 3 pins, No interrupts or constant updating required.
Con: Only a handful of colors.
Let's get the strip up and running using this method to start.
The most important thing to remember is that you need a lot of current (power) to drive these strips, so you will need to arrange a 5V power supply. This test will require about 1 Ampere per meter!
Note in the image above that the 5V can come from a separate power supply that can provide the power you need. Be sure to tie the grounds together and check the polarity…sticking -5V by accident into the strip could be a sad and expensive mistake. We'll be using an Arduino to demonstrate the strip but the code can easily be ported to your favorite microcontroller.
Note that we have Latch connected to digital I/O pin #2, Clock connected to #3 and Data to #4
To install the required library, first, open up the Arduino library manager:
Search for the HL1606 library and install it
We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
You should now see a new example folder called HL1606strip and inside, an example called basicPatterns. Upload that sketch to your Arduino. You should see the following:
You can change how long the strip is by adjusting the object creation (instantiation) line:
HL1606strip strip = HL1606strip(STRIP_D, STRIP_L, STRIP_C, 32);
The last argument "32" is the number of LEDs to address. Count how many are in your strip! The display may be wonky otherwise
The basicPatterns sketch has many examples of how to set the color of each pixel by calling
strip.setLEDcolor(n, color);
where n indicates which LED you want to change and color is RED, YELLOW, GREEN, TEAL, BLUE, VIOLET, WHITE, or BLACK. After you've set the pixel color, you need to write the changes to the strip by calling
strip.writeStrip();
writeStrip() isnt very fast, it will take a few milliseconds to write the changes and it takes longer the more LEDs there are. So change all the LED's you want at once and then write them!