MXLED controlled using two ports, a port as a data port and another as a control port. Both the data port and control port are received as a WM_USER message at the wParam. To determine that the received signal is a data or control, MXLED will look at the lParam. If lParam = 2, then the received signal is a signal to the data. Whereas if lParam = 1, then the received signal is a control signal.
There are six sizes provided by MXLED, ie 8 × 16, 8 × 32, 8 × 48, 16 × 16, 16 × 32, and 16 × 48. For each size there are two choices of orientation, ie landscape and portrait.
Control signals only use bit.0 and bit.1. Bit.0 used to reset the counter, while bit.1 used to increase the counter.
Data signal used to determine which LED where lit and LED where off. For each time, there were only eight LED that are controlled, which LED on the current column. To determine which columns is active, we use a counter. At the time counter is reset, then the column 0 is active. then if we provide the clock signal, the signal on bit.1, then the active column will move to column 1. Then if given the clock signal again, the active column will be column 2. and so on.
There are two choices of the clock signal, ie the L to H transition or the H to L transition.
The arrangement of the columns of LEDs depends on the size and orientation. For landscape orientation, then the left column is a lower column and the right column is a higher column. This applies to the size of 8x. As for the size of 16x, then the LED array is divided into two blocks of rows. The first column number of the second row block is the column number of the last column of the first row block plus 1.
More details are as follows:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
16 x 16 Row 0..7 : 0 1 2 ......15 Row 8..15: 16 17 18 ......31 16 x 32 Row 0..7 : 0 1 2 ......31 Row 8..15: 32 33 34 ......63 16 x 48 Row 0..7 : 0 1 2 ......47 Row 8..15: 48 49 50 ......95 |
For each block row, bit.0 will control the LED at the top, while bit.7 will control the LED at the bottom.
For portrait orientation, we divide the LED into a column or a block of columns and rows. Counter will determine which row is active. Top row is row 0, and will be active if the reset signal is activated. The active row increase along with the clock signal acquisition.
For the 8x size, column 0 is the leftmost column and activated by bit.0. Whereas column 7 is the rightmost column and activated by bit.7
Rule for the 16x size could be analogous to the position of landscape orientation.
MXLED simulated on the system to work like a real matrix. If we managed to change the active row or column slowly, then it can be seen only eight moving lights jumping around. However, if the changes is fast enough, then the lit changes of the LED will be seen steady not blinking. So the simulation MXLED will feel like a real LED matrix.
You can see examples of the use of this MXLED in the example Showing Images on LED Matrix using Simulator
Leave a Reply