Hardware Reference
In-Depth Information
In the preceding igure, the LED strip is powered by an external power supply. (The iny green
adapter represents the external power supply. The recommended power supply for the RGB
LED strip is 5V/2A per meter of LEDs (while wriing this chapter, we got an old computer power
supply to power up the LEDs). The Clock pins (the CI pin) and the Data pins ( DI ) of the first
segment of the RGB strip are connected to the pins D2 and D3 respecively. (We are doing
this since we will test the example from Adafruit industries. The example is available at
https://github.com/adafruit/LPD8806/tree/master/examples . )
Since the RGB strip consists of muliple segments that are serially connected, the Clock Out
( CO ) and Data Out ( DO ) pins of the first segment are connected to the Clock In ( CI ) and Data
In ( DI ) pins of the second segment and so on.
Let's review the example, strandtest.pde , to test the RGB LED strip. The example makes
use of Sotware SPI (Bit Banging of the clock and data pins for lighing efects). It is also possible
to use the SPI interface of the Arduino plaform. (Refer to this topic's website for an example.)
In the example, we need to set the number of LEDs used for the test. For example, we need
to set the number of LEDs on the strip to 64 for a two-meter strip. Here is how to do this:
1.
The following line needs to be changed:
int nLEDs = 64;
2.
Once the code is uploaded, the RGB matrix should light up, as shown in this image:
8 x 8 RGB matrix lit up
 
Search WWH ::




Custom Search