Cov txheej txheem:

Yuav Ua Li Cas Raspberry Pi Huab Cua Chaw Nres Tsheb: 5 Kauj Ruam
Yuav Ua Li Cas Raspberry Pi Huab Cua Chaw Nres Tsheb: 5 Kauj Ruam

Video: Yuav Ua Li Cas Raspberry Pi Huab Cua Chaw Nres Tsheb: 5 Kauj Ruam

Video: Yuav Ua Li Cas Raspberry Pi Huab Cua Chaw Nres Tsheb: 5 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Raspberry Pi Huab Cua Chaw Nres Tsheb
Yuav Ua Li Cas Raspberry Pi Huab Cua Chaw Nres Tsheb

Hauv qhov kev qhia no kuv yuav mus dhau cov txheej txheem ntawm kev txhim kho SenseHAT thiab xa cov cai yuav tsum tau tig SenseHAT mus rau hauv chaw ua haujlwm huab cua uas muaj peev xwm kaw qhov ntsuas kub, siab, thiab av noo.

Kauj Ruam 1: Cov Ntaub Ntawv thiab Cov Lus Txhais

Txhawm rau pib koj yuav xav tau cov ntaub ntawv hauv qab no:

Raspberry Pi 3 Nrog Raspbian teeb tsa (Raspbian yog Kev Ua Haujlwm)

SenseHAT

GPIO Pin Extender

Nab hab sej 3 Software

Txuj siv computer ntxiv (Keyboard, Mouse, Monitor)

Cov lus txhais thiab txuas uas koj tuaj yeem yuav/teeb tsa txhua qhov khoom muaj nyob hauv kab ntawv txuas.

Kauj ruam 2: Txhim kho SenseHAT

Txhim kho SenseHAT
Txhim kho SenseHAT

Thaum koj muaj tag nrho cov cuab yeej xav tau, koj yuav tsum pib los ntawm kev txhim kho SenseHAT. Ua ntej tshaj tawm Raspberry Pi, qhib lub davhlau ya nyob twg thiab ua cov lus txib no "sudo apt-tau hloov tshiab" yam tsis muaj cov cim hais, tom qab ntawv ua qhov lus txib no "sudo apt-get install sense-hat" dua, tsis hais cov lus hais. Thaum koj tau ua tiav cov lus txib yav dhau los khiav "sudo reboot" thiab cia Pi ua tus so. Thaum qhov ua tiav tiav, koj yuav tsum teeb tsa SenseHAT ntawm GPIO tus pin, koj yuav xav tau GPIO tus pin header yog tias koj SenseHAT tsis haum. Cov duab txuas nrog yog nws yuav tsum zoo li cas yog tias tau teeb tsa kom raug

Kauj ruam 3: Code

Code
Code

Thaum koj tau ua tiav Kauj Ruam 2, xyuas kom meej tias SenseHAT tau khau raj kom raug, cov LEDs yuav tsum tau teeb nyob rau hauv cov xim zaj sawv zoo ib yam li cov duab txuas ib zaug koj pib Raspberry Pi, yog tias nws tsis tau teeb tsa zoo li hauv daim duab, lossis tsuas yog qee qhov teeb tsa, tshem lub zog rau Raspberry Pi, tom qab ntawd txuas thiab txuas koj SenseHAT dua. Koj cov kauj ruam tom ntej yog txhawm rau ntsaws cov cai uas koj yuav siv los ua chaw nres tsheb huab cua ua haujlwm, txuas nrog cov kauj ruam no yog cov ntaub ntawv muaj tag nrho cov cai koj yuav xav tau kom muaj chaw nres tsheb huab cua uas tuaj yeem hloov kho tau kom sau cov ntaub ntawv nkaus xwb xav tau thiab yuav sau cov ntaub ntawv hais rau ib daim ntawv thib ob. Muab nws tso rau hauv / home / Directory. Kev kho tus lej yog yooj yim xws li hloov tus lej. Thaum koj tau xa cov cai, los khiav nws koj yuav tsum tau ua cov lus txib hauv qab no (yam tsis hais cov cim) "sudo python ~/logcript.py". Thaum koj tau khiav cov cai kom nres nws yooj yim nias CTRL+C thiab nws yuav xaus thiab koj yuav tuaj yeem saib cov ntaub ntawv koj nkag rau hauv tib phau ntawv. Txhawm rau hloov kho txoj cai yooj yim ntaus cov lus txib hauv qab no (tsis hais cov cim cim) "sudo nano ~/logcript.py". Qhov no yuav qhib cov cai hauv cov ntawv tsim thiab tso cai rau kev hloov kho yooj yim thiab kev hloov kho yog tias koj xav tau.

Kauj Ruam 4: Kev ua tiav

Kev ua tiav
Kev ua tiav

Thaum koj tau xa koj cov cai thiab kho nws raws li koj xav tau thiab khiav nws, txhua yam uas seem yog saib koj cov ntaub ntawv, nws tau sau rau hauv cov ntaub ntawv nrog hnub tim, thiab sijhawm hauv lub npe thiab tuaj yeem qhib hauv LibreOffice. Cov ntaub ntawv tau txheeb nrog hom ntaub ntawv raws li kab saum toj kawg nkaus, thiab tus nqi nyob hauv txhua kab ntawv, nrog lub sijhawm tau sau tseg hauv thawj kab ntawv.

Kauj ruam 5: Ua tiav

Yog tias koj tau ua raws cov kauj ruam dhau los kom raug koj yuav tsum muaj lub chaw ua haujlwm Raspberry Pi Huab Cua muaj peev xwm saib xyuas qhov kub thiab txias, thiab av noo. Nrog koj zoo siab tam sim no koj tuaj yeem khiav koj lub chaw nres tsheb huab cua thiab khaws cov ntaub ntawv!

Pom zoo: