105
for i in range(0, len(code_H)):
#
Assign elements of the column table in
sequence
hc595_shift(code_L[i])
# Write to the first data of the Row table
hc595_shift(code_H[i])
# Write to the first data of the COL table, and the
ROW data previously goes to the other HC595.
get_matrix(code_L[i], code_H[i])
# Print the 2D array on the CLI
time.sleep(0.1)
for i in range(len(code_H)-1, -1, -1):
#
Assign elements of the column table
in inverse order
hc595_shift(code_L[i])
hc595_shift(code_H[i])
get_matrix(code_L[i], code_H[i])
time.sleep(0.1)
You should see LEDs light up as you control.
Summary
Through this lesson, you have got the basic principle of LED dot matrix and how to program
the Raspberry Pi to drive an LED dot matrix based on 74HC595 cascade. With the knowledge
learnt, try more fascinating creations!
Further Exploration
If you want to display characters on the matrix, please refer to a python code:
https://github.com/sunfounder/SunFounder_Dot_Matrix
Содержание Super Kit 3.0
Страница 7: ...4 22 RGB LED 1 23 LED red 8 24 LED white 4 25 LED green 4 26 LED yellow 4 27 NPN Transistor S8050 2 ...
Страница 30: ...27 Also we have drawn a table of the corresponding BCM wiringPi and Name of each pins ...
Страница 78: ...75 Now pull the slide and you can see the two LEDs light up alternately ...