User Manual

109
}
void hc595_out(){ // Update the output data of the 74HC596
digitalWrite(RCLK, 1); // Everytime RCLK adds 1, the HC595 updates the output.
delay(1);
digitalWrite(RCLK, 0);
}
while(1){
for(i=0;i<sizeof(code_H);i++){ // The data of ROW and COL table for the matrix adds
1 each time.
hc595_in(code_L[i]); // Write to the first data of the Row table
hc595_in(code_H[i]); // Write to the first data of the COL table, and the ROW
data previously goes to the other HC595.
hc595_out(); // Update the output of the 74HC595; output the data controlled
by both two HC595, and the dot matrix will show the pattern.
delay(100);
}
for(i=sizeof(code_H);i>=0;i--){ // The data of ROW and COL table for the matrix
decreases by 1 each time.
hc595_in(code_L[i]); // Write to the first data of the Row table
hc595_in(code_H[i]); // Write to the first data of the COL table, and the ROW
data previously goes to the other HC595.
hc595_out(); // Update the output of the 74HC595; output the data controlled
by both two HC595, and the dot matrix will show the pattern.
delay(100);
}
}
For Python users:
Step 2: Get into the folder of code
cd /home/pi/SunFounder_Super_Kit_V3.0_for_Raspberry_Pi/Python
Step 3: Run
sudo python 15_DotMatrix.py
Code Explanation
# We use a Common Anode matrix, so ROW pins are the common anode, and COL, the common
cathode.
# row and column lists. When characters are displayed, an element in row and one in
column are acquired and assigned to the two HC595 chips respectively. Thus a pattern is
shown on the matrix.
SunFounder