Cov txheej txheem:

Raspberry Pi Cov Duab Duab Duab: 5 Kauj Ruam
Raspberry Pi Cov Duab Duab Duab: 5 Kauj Ruam

Video: Raspberry Pi Cov Duab Duab Duab: 5 Kauj Ruam

Video: Raspberry Pi Cov Duab Duab Duab: 5 Kauj Ruam
Video: Yasmi - Txiv Nraug Ntsuag ft. JN Vang (Music Video) 2024, Hlis ntuj nqeg
Anonim
Raspberry Pi Cov Duab Duab Duab
Raspberry Pi Cov Duab Duab Duab
Raspberry Pi Cov Duab Duab Duab
Raspberry Pi Cov Duab Duab Duab

Tom qab 10 xyoo, kuv lub khw-yuav cov duab thav duab tsis tiav. Kuv nrhiav kev hloov pauv online, thiab pom tias kev hloov pauv piv tau raug nqi ntau dua kuv li 10 xyoo thav duab. Kuv xav tias lawv yuav siv tau dawb los ntawm tam sim no. Pom tseeb kuv tuaj yeem nyuam qhuav yuav ib qho tshiab, tab sis kuv xav tias yog qhov uas tus txiv neej xav kom kuv ua! Hloov chaw, Kuv tuaj yeem siv sijhawm txaus luag tsim lub tsev kuv tus kheej - tab sis kuj tseem muaj kev lom zem thiab kawm qee yam raws txoj kev. Kuv tau ua si nrog Arduinos tau ntau xyoo, thiab xav tau txoj haujlwm zoo rau Raspberry Pi, thiab qhov no zoo li yog ib qho zoo tshaj plaws. Yog li kuv tau ua qhov qub Googling thiab pom tias muaj ntau txoj hauv kev xaiv los ua cov duab thav duab raws li Raspberry Pi. Hmoov tsis zoo, feem ntau ntawm lawv tsis yog qhov kuv xav tau. Qee qhov koj yuav tsum tau yuav software uas lwm tus tau sau, thiab kuv tsis xav ua qhov ntawd. Thaum kawg kuv pom qhov qhia tau zoo no thiab ua raws kuv txoj haujlwm ntawm nws

Kuv xav tau cov txheej txheem digital yooj yim uas yuav yooj yim hla cov duab ntawm USB ntiv tes xoo tsav. Kuv tsis xav tau lossis xav tau tswj nws los ntawm 1000 mais deb, tsis tas yuav xa email rau nws cov duab, thiab lwm yam. Kuv tsuas yog tso kuv cov duab ntawm tus ntiv tes xoo tsav thiab nws yuav tsum tso saib lawv. Thiab qhov ntawd yog dab tsi cov lus qhia qhia saum toj no - yam tsis muaj software tshwj xeeb thiab lwm yam. Kuv tau li cas los xij xav tau ob peb yam me me uas tsis tau them rau hauv cov lus qhia. Kuv xav teeb tsa nws kom lub vijtsam yuav tsis plam tawm tom qab teeb tsa ntu. Kuv xav tau txoj hauv kev kom muaj kev nyab xeeb qhib thiab tua yam tsis muaj keyboard thiab nas (tsuas yog rub lub zog ntawm Raspberry Pi tuaj yeem ua rau lub operating system tsis zoo). Nrog qhov cuam tshuam ntawm kev tshawb fawb kuv pom yuav ua li cas. Nws yog qhov yooj yim heev - Kuv tsuas yog yuav tsum paub tias vim li cas ntau txoj hauv kev tsis ua haujlwm rau kuv. Kuv kuj xav kom nws rov pib dua yog li ntawd thaum nws muaj zog nws mus ncaj qha rau hauv cov duab swb yam tsis muaj kev nqis tes ua los ntawm kuv (dua - tsis muaj keyboard thiab nas). Thiab thaum kawg, Kuv xav kom tuaj yeem tswj nws tus kheej thaum xav tau. Hauv paus kuv xav kom yooj yim tuaj yeem nqis mus rau tom ntej thiab rov qab, thiab tuaj yeem ncua ntawm daim duab. Kuv npaj yuav siv peb lub khawm rau qhov txuas mus rau GPIO tus pin. Thaum kawg kuv tau teeb tsa tus nas los ua cov kev tswj hwm no. Yog li kuv xaus nrog nas tom qab txhua qhov, tab sis nws tsis xav tau ib qho. Tsis muaj nas nws tsuas yog ua nws tus kheej nkaus xwb.

Kauj ruam 1: Yam Koj Yuav Tsum Tau

Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau

Lub computer saib nrog cov tswv yim HDMI. Kuv tau txais qhov zoo tshaj 21.5 zaub rau $ 89.99 ntawm Amazon … Acer SB220Q Full HD (1920 x 1080) IPS Ultra-Thin Zero Frame Monitor

Raspberry Pi 3 B+ ($ 38.30 ntawm Amazon). Koj kuj tseem tuaj yeem siv Raspberry Pi 3 B, tab sis muaj qhov sib txawv me me.

Ib lub hwj chim thiab kab. Xyuas kom tseeb thiab tau txais ib qho uas tso tawm kom txaus tam sim no thiab tau txais cov cable uas tuaj yeem nqa tam sim no. Nws hloov tawm tias feem ntau cov kab hluav taws xob USB tau yuag dhau thiab ua rau koj muaj hluav taws xob tsawg. Kuv muaj ib puag ncig, tab sis koj tuaj yeem tau txais qhov zoo los ntawm Amazon rau $ 10.99: Raspberry Pi 3 Lub Hwj Huam 5V 2.5A Micro USB AC Adapter Charger US Plug

Ib qho HDMI cable. Kuv tau txais ob 6 'HDMI cables rau $ 2.49 ntawm Ebay.

Ib rooj plaub rau Raspberry Pi (xaiv tau - tab sis hom zoo). Kuv tau txais acrylic "TSV Raspberry Pi 3 Case" los ntawm Walmart rau $ 5.04. Muaj ntau qhov kev xaiv rooj plaub. Qhov no ua haujlwm rau kuv, thiab muaj chav rau mount qhov pib thiab kaw cov nyees khawm, tab sis acrylic yog nkig heev. Kuv tswj tau txhawm rau txhawm rau 3 ntawm 4 lub rooj sib dhos tab txawm sim ua tib zoo saib xyuas nrog nws. Kuv muaj qee cov acrylic cement tso ncig, yog li nws tsis yog qhov teeb meem tiag. Tab sis yog tias koj tau txais cov ntaub ntawv acrylic, tej zaum koj yuav xav tau qee cov acrylic cement lossis daim kab xev meej los tuav nws ua ke. Kuv yuav tsis suav rau ntawm cov tabs. Cov ob peb khawm me me los txhawm rau ntawm rooj plaub rau kev pib thiab kaw. Ib zaug ntxiv, Kuv muaj ob peb lus dag nyob ib puag ncig, tab sis koj tuaj yeem tau txais kaum ob ntawm cov uas tau hais los saum toj no los ntawm Amazon rau $ 7.99. Kuv tseem siv peb tus poj niam tus pin txuas txuas txuas (raws li qhia saum toj no) thiab 1 tus pin rau txuas lub khawm rau Raspberry Pi GPIO tus pin Koj tuaj yeem tau txais 200 tus poj niam sib txuas los ntawm Ebay rau $ 0.99 (tshawb nrhiav: 2.54mm Dupont Jumper Wire Cable Housing Female Pin Connector Terminal). Kuv kuj siv 1 tus pin txuas lub khawm pib rau Raspberry Pi board (saib saum toj no). Koj tuaj yeem tau txais 40 qhov no los ntawm Ebay rau $ 0.99 (tshawb nrhiav: 2.54mm Txiv neej PCB Ib Leeg Ncaj Ncaj Ncaj Ncaj Ncaj Ncaj Ncaj Ncaj Ncaj Ncaj rau Arduino). Tus pin no yog nyob ntawm yeem. Koj tseem tuaj yeem txuas cov xaim ncaj qha rau ntawm lub rooj tsavxwm.

USB keyboard thiab nas. Cov keyboard tsuas yog xav tau rau teeb tsa. Yog tias koj xav kom tuaj yeem tswj cov swb swb ntawm tus kheej, koj yuav xav tso tus nas ntsaws rau hauv. Kuv tau ua rau lawv dag ib ncig, tab sis koj tuaj yeem tau txais lawv cov av pheej yig ntawm Amazon, Ebay, Walmart …

Micro SD daim npav; Kuv tau txais daim npav 16GB rau $ 5.44 los ntawm Amazon: Kingston Canvas Xaiv microSDHC Class 10

Thumb tsav; Kuv tau txais 32GB USB ntiv tes xoo tsav los ntawm Amazon rau $ 6.99: Kingston Digital DataTraveler SE9 32GB USB 2.0 Flash Drive

Ntoo los ua tus thav duab rau tus saib (xaiv tau). Kuv tau siv ib daim 2 "x 2" x 8 '"dawb" ntoo uas kuv tau txais los ntawm Tsev Depot rau qis dua $ 2.00 (kuj tseem siv lub foob los yog primer rau ntoo thiab qee qhov ib nrab xim dub tsuag xim).

Kauj ruam 2: Kho lub Raspberry Pi

Configuring Raspberry Pi
Configuring Raspberry Pi
Configuring Raspberry Pi
Configuring Raspberry Pi
Configuring Raspberry Pi
Configuring Raspberry Pi

Ua raws qhov txuas no txhawm rau rub tawm zip file ntawm "Raspbian Stretch with desktop thiab pom zoo software":

Muaj peb yam sib txawv. Nco ntsoov tias koj tau txais qhov kuv hais ntawm no.

Tam sim no ua raws cov lus qhia teeb tsa no rau nyem lub kaw lus ua haujlwm rau koj daim npav micro-SD:

Etcher yuav nyem SD daim npav ncaj qha los ntawm cov ntaub ntawv.zip, thiab tsis tas yuav tsum ua daim npav micro-SD ua ntej.

Txuas lub USB nas thiab USB keyboard rau hauv Raspberry Pi's USB slots (txhua qhov yuav ua).

Txuas lub Raspberry Pi mus rau hauv lub LCD saib nrog HDMI cable, thiab ntsaws lub hwj chim rau hauv Raspberry Pi kom khau raj nws. Thaum nws khau raj nws yuav tsum taug koj txoj hauv kev kom tau txais Raspberry Pi tham nrog koj lub wifi, thiab yuav rub tawm txhua qhov tsim nyog hloov tshiab.

Nrog Raspberry Pi tam sim no ntawm kab thiab hloov kho tshiab, nws yog lub sijhawm los rub tawm cov software tso tawm. Txhawm rau ua qhov no koj yuav tsum qhib lub qhov rais LXTerminal (nyem rau ntawm lub cim uas zoo li DOS tam sim ntawd nyob rau sab saum toj ntawm lub desktop).

Hauv lub qhov rai tshwm sim nkag mus rau qhov kev hais kom ua no txhawm rau teeb tsa cov duab software:

sudo apt-tau nruab feh

Tom ntej no ua tib yam rau nruab cov screensaver:

sudo apt-tau nruab xscreensaver

Tom ntej no peb yuav tsum teeb tsa nws kom cov ntxaij vab tshaus tsis tas sij hawm thiab khoob qhov screen …

  • Nyem rau ntawm "Menu" nyob rau sab saud sab laug ntawm lub desktop
  • Xaiv "Nyiam" thiab tom qab ntawd "Screensaver"
  • Ntawm qhov screenaver GUI, hauv "Hom" nco-down ntawv qhia zaub mov, xaiv "Disable Screen Saver"

Tom ntej no peb yuav teeb tsa tus nas kom tswj tus swb swb. Yog tias koj tsis xav kom muaj kev tswj tuav ntawm cov swb koj tuaj yeem hla qhov no.

Tsim cov ntaub ntawv hu ua "nyees khawm" (tsis muaj txuas ntxiv) hauv "/home/pi/.config/feh" (tej zaum koj yuav tsum ua daim ntawv "feh").

Koj tuaj yeem ua qhov no los ntawm LXTerminal qhov rai.

cd /home/pi/.config (qhov no yog Linux hais lus rau "hloov cov npe rau /home/pi/.config")

ls -la (qhov no yuav teev tag nrho cov ntaub ntawv thiab cov ntawv tais ceev tseg hauv /home/pi/.config. Tus -la qhia nws kom siv hom ntawv ntev thiab sau txhua cov ntaub ntawv).

Yog tias tsis muaj phau ntawv teev npe feh hauv cov npe (thiab tej zaum yuav tsis yog) koj yuav tsum tau ua ib qho:

mkd qab

Tam sim no nkag mus rau hauv phau ntawv ntawd:

cd fwj

Tam sim no uas peb nyob hauv daim nplaub tshev ntawd, peb yuav tsum ua cov ntawv "khawm".

sudo nano nyees khawm (qhov no yog linux rau super user ua nano-editor ntawm cov ntawv khawm)

Koj yuav tsum pom koj tus kheej hauv cov ntawv khoob. Muab cov hauv qab no tso rau hauv cov ntawv:

# unbind tswj tam sim no rau cov hauv qab no:

zoom pan menu prev_img next_img # Tam sim no khi cov kev ua no rau nas khawm 1, 2 (log), thiab 3 prev_img 1 toggle_pause 2 next_img 3

Txhawm rau txuag thiab tawm, sau CTRL-o, ntaus ENTER, thiab tom qab ntawd CTRL-x

Tom ntej no peb yuav teeb tsa Raspberry Pi kom rov pib dua qhov swb.

Txuas tus ntiv tes xoo tsav mus rau hauv Raspberry Pi thiab nrhiav seb nws lub npe hu li cas los ntawm kev mus rau /media /pi

(Koj yuav tsum tau muab cov duab tso rau hauv cov hauv paus hauv paus ntawm tus ntiv tes xoo. Koj tseem tuaj yeem muaj cov ntawv tais ceev tseg ntawm cov duab, lossis txawm tias cov ntawv tais ceev tseg hauv cov ntawv tais ceev tseg. Cov swb swb yuav rov qab los ntawm cov ntawv no).

Koj tuaj yeem pom lub npe ntawm tus ntiv tes xoo siv cov ntawv xa mus los ntawm sab saum toj ntawm Raspberry Pi desktop lossis hauv LXTerminal qhov rai nrog cov lus txib no:

cd /media /pib

ls -las

Tam sim no ua cov ntawv sau rau ntawm lub desktop hu ua "startup.sh" (Rt-nyem rau ntawm lub desktop; nyem rau ntawm "Tsim Tshiab …

Muab cov hauv qab no tso rau hauv cov ntawv no:

# tsaug zog li ob peb vib nas this kom muab USB lub sijhawm tsav tsheb rau nruab ua ntej khiav cov swb

pw 5 feh -Y -x -q -D 5 -B dub -F -Z -r --auto -tig/media/pi/thumb_drive_name

Tsis txhob ntaus "thumb_drive_name" hauv kab ntawv saum toj no. Muab lub npe tiag tiag ntawm tus ntiv tes xoo uas koj pom saum toj no rau hauv.

Txuag thiab tawm.

Hauv LXTerminal qhov rai koj tseem tuaj yeem ntaus tus txiv neej feh kom kawm paub txhua qhov kev xaiv muaj los ntawm feh slideshow (txiv neej feh yog Linus rau - qhia kuv phau ntawv qhia rau feh).

Tam sim no peb xav ua cov ntaub ntawv tshiab no ua tiav. Hauv LXTerminal qhov rai:

cd/tsev/pi/Desktop

chmod 755 startup.sh

Tam sim no peb yuav tsum tau kho cov ntaub ntawv "autostart" los qhia nws kom khiav lub plhaub ntawv ntawm kev pib.

Ntawm "Raspberry Pi 3 B" cov ntawv "autostart" yuav tsum muaj nyob hauv /home/pi/.config/lxsession/LXDE-pi

Ntawm "Raspberry Pi 3 B+" nws yuav tsum yog/etc/xdg/lxsession/LXDE-pi

Hauv LXTerminal qhov rai:

cd /home/pi/.config/lxsession/LXDE-pi (yog tias koj muaj Pi 3 B)

los yog

cd/etc/xdg/lxsession/LXDE-pi (yog tias koj muaj Pi 3 B+)

Los ntawm qhov ntawd:

sudo nano autostart pib

Ntxiv kab ntawv no kawg ntawm daim ntawv pib ua haujlwm kom ua raws tsab ntawv saum toj no:

CTRL-o kom txuag (thiab tom qab ntawd ntaus Enter)

CTRL-x kom tawm

Raspberry Pi yuav tsum tam sim no rov pib dua rau hauv koj qhov swb txawm tias tsis muaj keyboard lossis nas.

Koj tseem yuav xav tua "overscan" yog li koj daim duab mus rau ntawm ntug qhov screen:

Los ntawm sab saum toj ntawm Raspberry Pi desktop xaiv: Ntawv qhia zaub mov/Nyiam/Raspberry Pi teeb tsa

Tam sim no peb xav ua kom nws muaj peev xwm kaw tau zoo thiab khau raj Raspberry Pi nrog khawm thawb (tsis yog nrog keyboard thiab nas).

Hauv LXTerminal qhov rai:

sudo nano /boot /config.txt

Ntxiv kab no:

dtoverlay = gpio-kaw

CTRL-o kom txuag (thiab tom qab ntawd ntaus Enter) CTRL-x kom tawm mus

Tam sim no koj tuaj yeem ua rau Raspberry Pi ua kom muaj kev nyab xeeb kaw los ntawm luv GPIO Pin 5 (uas yog GPIO3) mus rau GPIO Pin 6 (uas yog hauv av) ntawm 40 tus pin header (peb yuav teeb tsa nws los ua qhov no nrog qhib ib txwm muaj), tiv tauj ib ntus, khawm). Saib daim duab saum toj no rau tus pin chaw. Tus Pin 1 yog tus nyob ze rau ntawm ntug ntawm lub rooj tsavxwm.

Txhawm rau rov pib dua koj tuaj yeem rub lub zog thiab ntsaws nws rov qab, lossis koj tuaj yeem luv RUN tus pin (lub ncoo cim "RUN" sab xis kawg ntawm 40 tus pin header) rau GND. Peb yuav teeb lwm lub pob kom ua li ntawd. Saib cov duab saum toj no txhawm rau nrhiav "Run" ncoo ntawm koj lub rooj tsavxwm.

Kauj Ruam 3: Ntxiv Case thiab Khawm

Tam sim no, peb tuaj yeem ntxiv qee qhov kev xaiv ua tiav.

Nws yog qhov zoo kom tau txais rooj plaub rau Raspberry Pi thiab nws muab koj qhov chaw rau mount qhov kaw thiab pib khawm. Kuv tau siv rooj plaub hais los, tab sis muaj ntau qhov xwm txheej muaj los ntawm Amazon, Walmart, Ebay … Xaiv qhov koj nyiam, tab sis nco ntsoov thiab tau txais ib qho rau tus qauv ntawm Raspberry Pi koj muaj. Qee qhov xwm txheej zoo nkauj haum. Nws yuav yog qhov zoo tshaj plaws kom zam tau cov ntawd yog li koj yuav muaj chav los txhawm rau kaw thiab pib khawm.

Siv lub laub-khawm ntawm hom piav qhia, laum ob peb lub qhov hauv Raspberry Pi rooj los txhawm rau khawm cov khawm ntawd. Nco ntsoov thiab teeb tsa lawv qhov chaw uas lawv yuav tsis tsoo rau hauv Raspberry Pi board. Yog tias koj siv ib qho ntawm cov ntaub ntawv acrylic koj yuav xav siv lub qhov nrog lub laum xovxwm, maj mam thiab ua tib zoo. Nws pab tuav cov acrylic nqes tawm tsam ib daim ntoo txoj cai nyob ib ncig ntawm lub qhov koj tab tom drilling. Acrylic yog nkig heev thiab yooj yim heev rau tawg thaum drilling. Laum maj mam thiab ua kom muaj zog ntawm cov acrylic nyob ib ncig ntawm lub qhov.

Nrog cov laub-khawm tau teeb tsa hauv rooj plaub koj yuav tsum tau nqes lawv mus rau tus pin uas tsim nyog. Txuas ib qho ntawm lub khawm txuas mus rau ib lub davhlau ya nyob twg ntawm lwm lub pob (los ntawm kev xaim hlau ntawm lawv). Tam sim no muab cov xaim txuas rau cov dav hlau uas yuav mus rau GPIO Pin 6 (GND). Ntawm qhov kawg ntawm cov xaim ntawd, txuas tus txuas ntawm hom pom nyob rau sab saum toj ntawm cov lus qhia no kom xaub nws mus rau GPIO tus pin. Kuv nyiam npog cov txuas nrog ib qho me me ntawm cov cua sov ua kom tubing kom nws tsis txhob tawm tsam cov pins nyob sib ze, thiab txhawm rau txhawm rau txhawm rau xaim.

Tam sim no muab cov xaim txuas mus rau lub davhlau ya nyob twg txawv ntawm qhov kaw-khawm. Muab tus txuas rau ntawm qhov kawg ntawm cov xov hlau thiab thawb nws mus rau GPIO Pin 5 (GPIO3). Lub pob no yuav tam sim no ua rau muaj kev nyab xeeb kaw ntawm Raspberry Pi.

Tam sim no muab cov xaim txuas mus rau lub davhlau ya nyob twg txawv ntawm qhov pib-khawm. Koj tuaj yeem xau qhov txuas qhov kawg ntawm cov xov hlau mus rau qhov hla "Run" ncoo ntawm Raspberry Pi pawg thawj coj, lossis koj tuaj yeem ntxiv tus pin rau lub ncoo ntawd thiab ntxiv qhov txuas rau xaim los thawb rau tus pin ntawd. Kuv tau ua qhov kawg. Tam sim no lub pob no yuav rov pib koj li Raspberry Pi pawg thawj coj yam tsis tas yuav rub lub zog thiab rov ua nws lub zog.

Kauj Ruam 4: Ua Ntoo Ntoo thiab Sawv Cev

Qhov no kuj yog nyob ntawm yeem. Koj tuaj yeem tawm ntawm tus saib ntawm nws sawv, tshem tawm sawv ntsug thiab ntxiv ib txhais ceg kom nws tsuas yog zaum ntawm lub desktop, lossis tshem tawm sawv ntsug, ntxiv ceg, thiab ntxiv ntoo ntoo. Kuv xaiv mus nrog tus ncej ntoo.

Kuv tshem tawm qhov sawv ntsug uas los nrog lub khoos phis tawj saib xyuas thiab tshem tawm cov hlau saum toj, nce ntu. Tom qab ntawd kuv tau txiav ib ceg rau nws tawm ntawm txhuas thiab ntsia nws mus rau kho vajtse mount. Qhov no cia kuv teeb cov zaub ntawm lub desktop ntau dua li daim duab thav duab.

Tom qab ntawd kuv tau ua tus ncej ntoo tawm ntawm 1.5 "los ntawm 1.5" los ntawm 8 'ntoo dawb. Kuv tau ua qhov no siv lub rooj pom thiab miter pom. Tom qab ntawd kuv tau kaw cov ntoo nrog cov xim pleev xim thiab muab nws ob peb lub tsho tiv no ib nrab xim dub tsuag xim. Kuv tsis mus rau hauv cov ntsiab lus ntawm kev ua tus ncej ntoo, tab sis tsis muaj khawv koob rau nws. Yog tias tib neeg nug nws hauv cov lus saib tsam kuv yuav ntxiv cov ntsiab lus ntawd.

Kauj Ruam 5: Siv Tus Qauv Tiav

Yog li ntawd nws yog Koj tuaj yeem tso ntau daim duab ntawm tus ntiv tes xoo tsav ntawm qib cag. Koj tseem tuaj yeem ntxiv cov ntawv tais ceev tseg, thiab cov ntawv tais ceev tseg hauv cov ntawv tais ceev tseg. Koj tuaj yeem ncua qhov swb los ntawm nias lub pob nas/lub log nruab nrab, qhia nws kom thaub qab ib daim duab ib zaug los ntawm nias lub pob nyem sab laug, lossis qhia nws ua ntej ib daim duab ntawm ib lub sijhawm los ntawm nias lub pob nyem sab xis.

Kuv vam tias koj muaj kev lom zem tsim qhov no thiab txaus siab rau koj cov duab thav duab digital.

Thov tsis txhob yig tau nug cov lus lossis tawm tswv yim hauv cov lus. Kuv yuav sim teb lawv thiab hloov kho cov lus qhia raws li tsim nyog kom ua kom pom tseeb li sai tau.

Pom zoo: