Cov txheej txheem:

Siv LCDs ntawm Raspberry Pi: 4 Kauj Ruam
Siv LCDs ntawm Raspberry Pi: 4 Kauj Ruam

Video: Siv LCDs ntawm Raspberry Pi: 4 Kauj Ruam

Video: Siv LCDs ntawm Raspberry Pi: 4 Kauj Ruam
Video: Военные тактические часы-Топ-10 самых жестких военных ч... 2024, Hlis ntuj nqeg
Anonim
Siv LCDs ntawm Raspberry Pi
Siv LCDs ntawm Raspberry Pi

Hauv Cov Lus Qhia Kuv yuav qhia koj li cas siv 16x2 LCD npo nrog Raspberry Pi siv kuv tus lej tshwj xeeb. Kuv tus lej yog hloov kho tshiab ntawm Matt Hawkins 'LCD server code, uas ua rau nws yooj yim dua xa cov ntawv mus rau lub vijtsam. Txhua yam nws siv: khiav cov cai, thiab nws yuav nug yam koj xav luam tawm ntawm LCD. Ntaus nws thiab ntaus 'Enter'. Ua tiav Tom qab ntawd nws yuav nug yog tias koj xav tshem lub vijtsam. Tsuas yog ntaus nkag thiab txhua yam rov ua dua. Cia peb pib.

Kauj Ruam 1: Kev Txuas Hluav Taws Xob

Qhov thaiv
Qhov thaiv

Thawj kauj ruam yog thaiv kab. Yog tias koj lub LCD tseem tsis tau muaj lub taub hau tso rau ntawm koj koj yuav tau ntxiv lawv. Tom qab ntawd, siv lub khob cij thiab jumper xov txuas rau txhua qhov tab sis plaub ntawm LCD pins rau Pi. Kev siv daim ntawv qhia zaub mov tsis tas yuav tsum tau, tab sis ua kom yooj yim dua. Txhua tus lej GPIO tus lej yog BCM hom ntawv, tsis yog hom BOARD.

01. Qaum02. 5 tx03. Hauv av nrog 2.2k Ohm resistor04. GPIO 2605. Hauv av 06. GPIO 1907. N/A08. Tsis muaj/A09. N/A10. N/A11. GPIO 1312. GPIO 613. GPIO 514. GPIO 1115. 5V nrog 270 Ohm resistor16. Hauv av

Kauj ruam 2: Txoj Cai

Txoj Cai
Txoj Cai

Tom ntej no yog qhib cov cai hauv qab no hauv Python 2; Kuv nyiam IDLE 2. Tom qab ntawd txuag.

Kauj ruam 3: Khiav

Khiav
Khiav
Khiav
Khiav

Tom ntej no khiav qhov program*. Python plhaub yuav tsis ua dab tsi rau peb vib nas this ces yuav nug seb koj xav tau dab tsi ntawm kab ib. Ntaus koj cov ntawv thiab ntaus nkag. Nco ntsoov tias cov ntawv tsis ntev tshaj 16 cim. Tom qab ntawd nws yuav nug seb yuav luam dab tsi ntawm kab ob. Ua tib yam li ua ntej. Yog tias tsis xav tau cov ntawv, tsuas yog ntaus nkag. Raws li koj yuav pom, cov ntawv yuav tshwm ntawm LCD thiab 'Clear?' yuav tshwm nyob rau hauv plhaub. Muaj 6 cov lus txib meej.

1. Nkag mus - yooj yim tshem lub LCD2. 'Y' lossis 'y' ces nkag mus - yooj yim tshem lub LCD3. 'N' lossis 'n' ces nkag mus - tsis tshem cov ntawv tawm ntawm qhov screen4. '-kill-'-tua qhov program5. '1' - tsuas yog tshem kab 16. '2' - tsuas yog tshem kab 2

Ntaus cov lus hais kom meej meej thiab ntaus nkag. Tam sim no tag nrho txoj haujlwm yuav rov ua dua.

* Tus nab npawb sej yuav tsis ua haujlwm thawj zaug. Yog li kaw IDLE thiab qhib lub davhlau ya nyob twg. Ntaus 'sudo idle' thiab IDLE 2 yuav qhib. Tam sim no qhib cov ntaub ntawv code thiab khiav.

Kauj ruam 4: Ua tiav

Ua tiav
Ua tiav

Qhov ntawd yog nws. Koj tuaj yeem muaj sijhawm lom zem siv LCD. Xav tias dawb los hloov cov cai thiab siv nws rau koj tus kheej cov haujlwm.

Pom zoo: