Cov txheej txheem:

Raspberry Pi Christmas Ntoo: 6 Cov Kauj Ruam (nrog Duab)
Raspberry Pi Christmas Ntoo: 6 Cov Kauj Ruam (nrog Duab)

Video: Raspberry Pi Christmas Ntoo: 6 Cov Kauj Ruam (nrog Duab)

Video: Raspberry Pi Christmas Ntoo: 6 Cov Kauj Ruam (nrog Duab)
Video: tuav wb lub neej kom ruaj khov - Mang Vang ft. Christina Xyooj [Official Audio] 2021-22 2024, Kaum ib hlis
Anonim
Image
Image
Yuav tsum tau kho vajtse
Yuav tsum tau kho vajtse

Koj puas tau xav kom muaj kev tswj hwm koj lub teeb Christmas? Cov ntawv qhia no yuav qhia tawm cov kauj ruam tseeb rau kev ua tsob ntoo Christmas siv los ntawm Raspberry Pi, ANAVI Lub teeb pHAT thiab pheej yig 12V RGB LED sawb. Qhov no yog qhov tseeb tsis yog qhov kev daws teeb meem pheej yig tshaj rau kev kho kom zoo nkauj rau hnub so tab sis nws yog kev lom zem thiab muaj txiaj ntsig zoo los xyaum koj cov txuj ci txuj ci.

Kauj Ruam 1: Yuav Tsum Kho Vajtse

Txhawm rau tsim Raspberry Pi Christmas tsob ntoo koj yuav xav tau:

  • Ntoo Christmas
  • Raspberry Pi (txhua tus qauv lossis version ntawm Raspberry Pi nrog 40 tus pin header)
  • ANAVI Lub teeb pHAT
  • 12V RGB LED sawb
  • USB fais fab mov
  • 12V fais fab mov nrog DC nkaus 5.5x2.1mm
  • MicroSD daim npav nrog Raspbian

Koj tuaj yeem siv ib qho 12V RGB LED sawb. Xaiv qhov ntev ntawm txoj hlua sib thooj rau qhov loj ntawm koj tsob ntoo Christmas. Cov 12V RGB LED strips yog cov khoom muag. Lawv pheej yig heev thiab yooj yim mus nrhiav. Hauv daim vis dis aus no kuv tab tom siv 1 meter ntev sawb nrog 30 LEDs hauv nws.

Kauj Ruam 2: Sib dhos Cov Khoos Phis Tawj

Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse

Sib sau kho vajtse nrog koj txhais tes liab qab. Txuas lub RGB LED sawb rau ANAVI Lub teeb pHAT siv tus ntsia hlau tsav thiab khau raj Raspberry Pi raws li qhia hauv video.

ANAVI Lub teeb pHAT yog qhov qhib khoom kho vajtse Raspberry Pi ntxiv rau ntawm pawg thawj coj tshwj xeeb tsim los tswj cov xim tus nqi qis 12V RGB LED sawb ntawm peb MOSFETs. Siv nws yog qhov yooj yim heev los tsim txoj haujlwm hauv ob peb feeb xwb.

Kauj Ruam 3: Nruab PiGPIO

Nruab PiGPIO
Nruab PiGPIO

Ntawm koj tus Raspberry Pi qhib lub davhlau ya nyob twg thiab teeb tsa qhov hloov tshiab kawg ntawm piGPIO thiab Git los ntawm kev ntaus cov lus txib hauv qab no:

sudo apt-tau hloov tshiab

sudo apt -tau nruab -y pigpio git

Kauj Ruam 4: Tau Txais Qhov Code

Tau txais qhov Code Code
Tau txais qhov Code Code

Daim ntawv thov demo rau kev tswj hwm 12V RGB LED sawb yog pub dawb thiab qhib qhov chaw. Nws muaj nyob ntawm GitHub. Ua raws li cov lus txib hauv qab no hauv lub davhlau ya nyob twg kom tau txais qhov chaws:

git clone

Kauj Ruam 5: Tsim Daim Ntawv Thov

Tsim Daim Ntawv Thov
Tsim Daim Ntawv Thov

Ua raws li cov lus txib hauv qab no hauv lub davhlau ya nyob twg los tsim daim ntawv thov demo:

cd anavi-piv txwv/anavi-light-phat/light-demo

ua

Daim ntawv thov demo tau sau ua hom lus C programming. Nws tsim software uas txhais cov mem tes-dav tes taws los piav xim ntawm RGB LED sawb los ntawm peb MOSFETs ntawm ANAVI Lub teeb pHAT.

Ntawm txhua qhov thib ob qhov kev zov me nyuam teeb tsa tus lej tsis raug hauv thaj tsam ntawm 0 txog 255 ntawm txhua ntawm peb lub ntsiab xim. Kev sib xyaw ua ke ua ntau dua 16 lab xim! Txawm hais tias xim tau txiav txim siab tsis xwm yeem, lub hauv paus chaws tau sau rau hauv txoj hauv kev kom muaj txoj hauv kev uas ib ntawm peb lub ntsiab xim yog ci dua li lwm qhov.

Kauj ruam 6: Tua tawm Daim Ntawv Thov

Tua tawm Daim Ntawv Thov
Tua tawm Daim Ntawv Thov
Tua tawm Daim Ntawv Thov
Tua tawm Daim Ntawv Thov
Tua tawm Daim Ntawv Thov
Tua tawm Daim Ntawv Thov

Ua cov lus txib hauv qab no kom pib daim ntawv thov:

sudo pigpiod

./demo

Daim ntawv thov demo sau lub voj tsis muaj qhov kawg. Txhawm rau txiav nws tus neeg siv yuav tsum nias ib txhij ntawm nws cov keyboard Ctrl thiab C. Qhov ntawd yog nws! Txaus siab rau cov hnub caiv thiab zoo siab nyiag nkas!

Pom zoo: