Cov txheej txheem:

Interface 16x2 Alphanumeric LCD And4x4 Matrix Keypad Nrog Raspberry Pi3: 5 Cov Kauj Ruam (nrog Duab)
Interface 16x2 Alphanumeric LCD And4x4 Matrix Keypad Nrog Raspberry Pi3: 5 Cov Kauj Ruam (nrog Duab)

Video: Interface 16x2 Alphanumeric LCD And4x4 Matrix Keypad Nrog Raspberry Pi3: 5 Cov Kauj Ruam (nrog Duab)

Video: Interface 16x2 Alphanumeric LCD And4x4 Matrix Keypad Nrog Raspberry Pi3: 5 Cov Kauj Ruam (nrog Duab)
Video: How to Interface 4x3 Matrix Keypad With Arduino And LCD - Proteus 2024, Kaum ib hlis
Anonim
Interface 16x2 Alphanumeric LCD And4x4 Matrix Keypad Nrog Raspberry Pi3
Interface 16x2 Alphanumeric LCD And4x4 Matrix Keypad Nrog Raspberry Pi3

Hauv cov lus qhia no, peb piav qhia yuav ua li cas cuam tshuam 16x2 LED thiab 4x4 matrix keypad nrog Raspberry Pi3.

Peb siv Python 3.4 txhawm rau txhim kho software. Koj tuaj yeem xaiv Python 2.7 ib yam nkaus, nrog kev hloov me ntsis

Kauj Ruam 1: Cov Ntaub Ntawv Yuav Tsum Tau

Cov Ntaub Ntawv Yuav Tsum Tau
Cov Ntaub Ntawv Yuav Tsum Tau

Peb xav tau cov khoom siv hauv qab no

  • Raspberry Pi 3
  • 5V 2A Adapter rau Pi
  • 8GB micro SD
  • 16x2 Alphanumeric LCD
  • 4 x 4 matrix Keypad
  • Dot PCB (qhov loj me me) lossis Breadboard
  • Berg Sawb
  • Jumper Hlau
  • 10K kub
  • Ethernet Cable (txhawm rau tsim VNC txuas nrog Laptop)

Kauj ruam 2: Teeb Kho Vajtse

Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb

Peb tsis suav nrog cov kauj ruam rau teeb tsa kho vajtse xws li hlawv OS mus rau micro SD thiab VNC interface. Koj yuav tsum nrhiav lwm cov peev txheej rau cov txheej txheem no.

Ntxig OS ua ntej thauj khoom 8GB Micro SD daim rau hauv Rapberry Pi 3. Txuas Raspberry Pi mus rau Laptop los ntawm Ethernet Cable. Ua cov cuab yeej kho mob raws li tau piav qhia hauv kab duab kab.

16x2 LCD Zaub

Peb siv 4-ntsis hom lcd interface, yog li qhov xav tau tus pin rau Tswj hu nkauj yog RS, EN, D4, D5, D6, D7 uas txuas nrog GPIOs ntawm Raspberry Pi.

4x4 Matrix Keypad

Nruab Python pob rau 4x4 thiab 4x3 matrix keypad thiaj li cuam tshuam kev ua haujlwm raws li tau ua. Yog li tsis tas yuav tshuaj xyuas cov keypad kab thiab kab txhua lub sijhawm. Ntawm no sab hauv rub-siv siv yog li tsis muaj sab nraud rub-up resistor xav tau.

Txuas Raspberry Pi mus rau lub vev xaib, tom qab ntawd qhib davhlau ya nyob twg thiab ntaus cov hauv qab no:

sudo python3.4 -m pip nruab pad4pi

Kauj Ruam 3: Daim Kab Xev

Daim duab thaiv
Daim duab thaiv

Cov Pins LCD:

  • LCD_RS = 21
  • LCD_E = 20
  • LCD_D4 = 26
  • LCD_D5 = 19
  • LCD_D6 = 13
  • LCD_D7 = 6

KeyPad tus pin:

Kab Pins = 17, 15, 14, 4Row Pins = 24, 22, 27, 18

Koj tuaj yeem xaiv ib qho GPIO tus pin rau cuam tshuam LCD thiab Keypad, tsuas yog hloov tus lej tus lej hauv tus lej. Koj tuaj yeem siv lub khob cij los yog PCB rau cuam tshuam nrog LCD thiab Keypad.

Kauj ruam 4: Python Code

Python Code
Python Code

Koj tuaj yeem rub tawm cov cai ncaj qha. Khiav code.py nrog nab hab sej 3.4 hauv koj li Raspberry Pi 3. Los yog luam cov ntawv thiab muab tso rau hauv cov ntawv sau tshiab ntawm nab nab 3.4.

Khiav qhov program:

LCD yuav tso tawm cov ntawv "Zoo Siab Txais Tos" hauv kab thawj yog tias kev sib txuas uas koj tau ua yog raug. Cov ntaub ntawv Keypad tau tshwm rau kab thib ob.

Kauj Ruam 5: Tso Tawm Ua Ntej

Tso Tawm Ua Ntej
Tso Tawm Ua Ntej
Tso Tawm Ua Ntej
Tso Tawm Ua Ntej
Tso Tawm Ua Ntej
Tso Tawm Ua Ntej

Kuv tau ntxiv Keyboard cuam tshuam, yog li yog tias koj tso qhov program LCD yuav tso saib zoo

Pom zoo: