Você está na página 1de 1
LED Displays (8 x 8 LED Matrix) The Pieces The Theory & Code 8 x 8
LED Displays
(8 x 8 LED Matrix)
The Pieces
The Theory & Code
8 x 8 Bi-Colour
LED Matrix
LED Matrix
LED Matrix's are great fun, you can create funky patterns, scroll messages, or
(common anode)
x1
create something entirely bizarre. Sadly controlling one is a tad complicated. But
once mastered is easily repeatable.
.: A quick refresher on LED control can be found here tinyurl.com/cmn5nh :.
Matrix Wiring
1K ohm Resistor
(brown-black-red)
x8
The Schematic
Each matrix has 128 LEDs (64 Red & 64 Green) however there is noticeably not
256 leads. Instead the LEDs are wired into a matrix. This matrix has the LED's
anodes connected across rows (8 pins) then the red and green LED's cathodes
attached across columns (8 pins each). To light an LED connect it's rows anode
to +5volts, and through a resistor, it's columns cathode to ground. (you can try
this without a micro-controller)
Displaying Images (Scanning)
analog
analog
analog
analog
pin 10
pin 11
pin 12
pin 13
pin 0
pin 1
pin 2
pin 3
pin 2
resistor
(1K Ohm)
pin 3
resistor
(1K Ohm)
pin 4
resistor
(1K Ohm)
Now that we can light any LED we choose it's time to move on to displaying a
(small) image. To do this we will use a scan pattern. In the example code we
define a bitmap image (an array of 8 bytes, each bit representing one LED).
Next we scan through this array one byte at a time, displaying one column then
the next. If we do this fast enough (about 1000 times a second) it appears as an
image. It sounds complex but if you download the code and play around it
should quickly become clear. (play around with the delay times to see the flicker)
pin 5
resistor
(1K Ohm)
pin 6
resistor
Example Code
.: Code to test your display a test pattern http://tinyurl.com/yjozkrr :.
(1K Ohm)
pin 7
resistor
(1K Ohm)
.: Code to scroll a message across the display http://tinyurl.com/yl3pc28 :.
More Things to Try
pin 8
resistor
(1K Ohm)
Dislike Red? you can switch to green by shifting the column pins from COL-R to
pin 9
resistor
(1K Ohm)
COL-G. Using too many Digital pins? Try controlling the display using shift
registers (74HC595) tinyurl.com/l43cph or a dedicated display chip (MAX7219)
http://tinyurl.com/4s2oo7 (arduino.cc)
.: Full Datasheet & Pinout http://tinyurl.com/yff4v8u :.
The Circuit
The Layout Sheet
NOTE
the location of pin 1
is printed on the
underside of the matrix
AA
BB
CC DD
EE
FF
GG HH
II
JJ
13
12
ROW-4
11
8x8
11
8-ROW
14
11
R-COL-4
22
22
8-COL-R
Matrix
15
10
G-COL-4
33
(common anode)
33
9-COL-G
16
9
ROW-3
44
44
7-ROW
17
8
R-COL-3
55
55
7-COL-R
18
7
G-COL-3
66
66
7-COL-G
19
6
ROW-2
77
77
6-ROW
20
5
R-COL-2
88
88
6-COL-R
21
4
G-COL-2
99
99
6-COL-G
22
3
ROW-1
1010
1010
5-ROW
23
2
R-COL-1
1111
1111
5-COL-R
NOTE
24
1
G-COL-1
1212
1212
5-COL-G
the matrix is larger than
the breadboard. Install the
wires, fold them outwards
then insert the matrix.
1313
1313
to pin 10
1414
1414
to pin 11
1515
1515
to pin 12
1616
1616
to pin 13
1717
1717
to analog 0
1818
1818
to analog 1
1919
1K Ohm
1919
to analog 2
2020
2020
to analog 3
2121
2121
2222
2222
to pin 2
2323
2323
to pin 3
2424
2424
to pin 4
2525
2525
to pin 5
2626
2626
to pin 6
2727
2727
to pin 7
2828
2828
to pin 8
CIRC-21
2929
2929
to pin 9
LED Displays
3030
3030
(8 x 8 Bi-Colour Matrix)
AA
BB
CC DD
EE
FF
GG HH
II
JJ
.: Instructions: print out, cut out, get making :.
.: for more details visit: http://tinyurl.com/yhwxv6h :.