There is one caveat when using these RGB LED strips. When using solid colors like red, green, or blue, the color looks great. However, when you try to create a brown
or lime green, for example, you will find that you
have to tinker with the RGB values to get what you
want. These strips do not translate the standard RGB
triples as accurately as an LCD or LED monitor on a
Adafruit is one supplier of these RGB LED strips,
which they call Neopixels. They have some very
good tutorials on how to practically use and
program them. Go to
https://learn.adafruit.com/adafruit-neopixel-uberguide/overview for details. Adafruit’s
■ FIGURE 1. Wiring the strips together.
strip.setPixelColor(num, red, green, blue);
// sets the color, using values 0 - 255 for
// each color.
// this turns on the LEDs you have programmed
// with colors.
Neopixel library is excellent and I use it for this project.
Let’s start with a simple example of creating a half
meter square array using strips with 30 LEDs per meter.
Our array will be 15 LEDs square for a total of 225 LEDs.
We will cut out strips with 15 LEDs and glue the strips
down with a spacing of 3. 33 centimeters (about 1-5/16
inch) between strips. Looking at the array in Figure 1 and
starting at the bottom right corner, the end of each strip
needs to be wired to the start of the strip above at its left
end. Looking at this as an X by Y array (X width and Y
// When we setup the NeoPixel library, we tell
it how many pixels, and which pin to
// use to send signals. In our case 15 x 15
// = 225 pixels and we will use pin D6.
// Check the NeoPixel library for using the
// default NEO_GRB + NEO_KHZ800 value,
// which I found usually works just fine.
Adafruit_NeoPixel pixels =
Adafruit_NeoPixel(225, 6, NEO_GRB + NEO_KHZ800);
num = y 15 + x
// This initializes the NeoPixel library.
// This sets the brightness of the LEDs
to locate the LED to program. Note that the value 15 is
the height of our array. Using the Adafruit Neopixel library,
we would use:
Here’s a complete program to draw a blue diagonal
from the bottom left corner to the top right corner of our
15 x 15 array:
for(int i=0;i<15; i++)
int num = i 15 + i
// pixels.Color takes RGB values, from 0,0,0
// up to 255,255,255
// Moderately bright blue color.
// This sends the updated pixel color to
// the hardware.
// Delay for 1 second.
It's possible to mount the cut strips differently with
every other strip going right to left. This will reduce the
length of the wires needed between strips, but does
require some additional software changes. Using our 15 x
15 array example, we would calculate num with this
Here’s another example. Create an array of 16 x 16
LEDs which will represent either a chess or checker board
(an 8 x 8 array) using blocks of four LEDs for each square.
Here are the four formulas to select the LEDs to turn on
if (y% 2 > 0)