User Manual

111
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 driv e 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.
SunFounder