User Manual

103
flag = 1
num = random.randint(1,6) # Generate a random number from 1~6.
hc595_shift(SegCode[num-1]) Output the hexadecimal values in list by 74HC595.
Now you should see a number flashing between 0 and 6 quickly on the segment display.
Press the button on the breadboard, and the display will statically display a random number
between 0 and 6 for 2 seconds and then circularly flash randomly between 0 and 6 again.
Summary
Through this lesson, you may have mastered the basic principle and programming for 7-
segment display based on Raspberry Pi, as well as more knowledge about using 74HC595.
Now you can apply what you’ve learnt and put it into practice to create your own works!
SunFounder