SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
(continued from previous page)
rclk
.
high()
time
.
sleep_ms(
5
)
while
True
:
for
num
in
range
(
10
):
hc595_shift(SEGCODE[num])
time
.
sleep_ms(
500
)
When the program is running, you will be able to see the LED Segment Display display 0~9 in sequence.
How it works?
hc595_shift()
will make 74HC595 output 8 digital signals. It outputs the last bit of the binary number to Q0,
and the output of the first bit to Q7. In other words, writing the binary number “00000001” will make Q0 output high
level and Q1~Q7 output low level.
Suppose that the 7-segment Display display the number “1”, we need to write a high level for b, c, and write a low
level for a, d, e, f, g, and dg. That is, the binary number “00000110” needs to be written. For readability, we will use
hexadecimal notation as “0x06”.
•
•
Similarly, we can also make the LED Segment Display display other numbers in the same way. The following table
shows the codes corresponding to these numbers.
Table 2: Glyph Code
Numbers
Binary Code
Hex Code
0
00111111
0x3f
1
00000110
0x06
2
01011011
0x5b
3
01001111
0x4f
4
01100110
0x66
5
01101101
0x6d
6
01111101
0x7d
7
00000111
0x07
8
01111111
0x7f
9
01101111
0x6f
Write these codes into
hc595_shift()
to make the LED Segment Display display the corresponding numbers.
3.4.17 Liquid Crystal Display
LCD1602 is a character type liquid crystal display, which can display 32 (16*2) characters at the same time.
As we all know, though LCD and some other displays greatly enrich the man-machine interaction, they share a com-
mon weakness. When they are connected to a controller, multiple IOs will be occupied of the controller which has
no so many outer ports. Also it restricts other functions of the controller. Therefore, LCD1602 with an I2C bus is
developed to solve the problem.
•
Inter-Integrated Circuit - Wikipedia
100
Chapter 3. For MicroPython User
Summary of Contents for Thales Kit
Page 1: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 Jimmy SunFounder Jun 04 2021 ...
Page 2: ......
Page 4: ...ii ...
Page 6: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 2 CONTENTS ...
Page 140: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 136 Chapter 3 For MicroPython User ...
Page 164: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 160 Chapter 4 For Arduino User ...