Cov txheej txheem:

Lightshowpi Project: 4 Kauj Ruam
Lightshowpi Project: 4 Kauj Ruam

Video: Lightshowpi Project: 4 Kauj Ruam

Video: Lightshowpi Project: 4 Kauj Ruam
Video: Mob Txaus Lawm - Txhaij Lauj Ft. Tijlaug Xab Thoj (Special Project) 2024, Hlis ntuj nqeg
Anonim
Qhov project Lightshowpi
Qhov project Lightshowpi
Qhov project Lightshowpi
Qhov project Lightshowpi
Qhov project Lightshowpi
Qhov project Lightshowpi
Qhov project Lightshowpi
Qhov project Lightshowpi

Nyob zoo sawv daws! Nov yog kuv daim ntawv qhia yuav ua li cas los tsim lub teeb pom kev zoo siv lightshowpi raws li lub Kaum Hlis 2020.

Kauj ruam 1: Sau koj cov khoom siv

Txog txoj haujlwm no koj yuav xav tau cov hauv qab no:- Raspberry Pi (Kuv tau siv Tus Qauv B+ uas kuv tau yuav ntawm lub siab zoo xyoo dhau los. Raws li kuv paub, qhov no yuav ua haujlwm nrog txhua tus pi tshwj tsis yog rau 4, txawm li cas los xij kuv tsis tuaj yeem txheeb xyuas qhov ntawd.)

www.raspberrypi.org/products/

- SD Card/Micro SD Card (Qhov no nyob ntawm seb koj siv dab tsi. Txhua yam 16GB lossis loj dua yuav tsum txaus)

www.walmart.com/ip/SanDisk-32GB-microSDHC-…

- Micro USB fais fab cable (rau Raspberry Pi)

- Sainsmart 8 Channel Solid State Relay Board

www.sainsmart.com/products/8-channel-5v-so…

- 10 Channel Faib Cov Hluav Taws Xob Thaiv

www.speedwaymotors.com/Electrical-10-Termi…

- Plaub Qhov Chaw Nyuaj Siab

www.walmart.com/ip/Hyper-Tough-Grounding-D…

- Ob Hyper Tough 2 Gang Box

www.walmart.com/ip/Hyper-Tough-2-Gang-Swit…

- Txiv neej rau txiv neej, Txiv neej rau poj niam, thiab poj niam rau poj niam Jumper Wires

www.amazon.com/gp/product/B072L1XMJR/ref=p…

- 16 Cov ntsuas hlau

www.walmart.com/ip/16-Gauge-Red-Black-Powe…

- HiLetGo Digital FM Transmitter

www.amazon.com/gp/product/B07X3Z8YTD/ref=p…

- Hlau txiav thiab hlau stripper

www.walmart.com/ip/Wire-Stripper-Universal…

- Daim kab xev hluav taws xob

- Soldering Hlau

www.walmart.com/ip/Hyper-Tough-30-Watt-Sol…

- Lub khoos phis tawj/khoos phis tawj nrog SD Card nyeem ntawv/sau ntawv

- Ob lub zog ntsaws ntsaws

www.amazon.com/ARyee-Universal-Compatible-…

Kauj Ruam 2: Pib Txuas

Pib Teeb
Pib Teeb
Pib Teeb
Pib Teeb
Pib Teeb
Pib Teeb
Pib Teeb
Pib Teeb

Ua ntej peb teeb tsa raspberry pi, koj yuav xav mus tom ntej thiab ua txhua yam tsim nyog thaiv txoj kev ntawd tom qab koj teeb tsa pi koj tuaj yeem mus tom ntej thiab sim kho vajtse tom qab ntawd. Txhawm rau pib koj yuav xav rub daim ntawv siv rau GPIO tus pin teeb tsa ntawm koj li pi. Piv txwv li ib qho uas kuv tau siv yog txuas nrog cov kauj ruam no.

Ntawm Sainsmart lub rooj tsavxwm, nqa lub taub hau ntswj taub hau thiab tshem tag nrho cov channel ntsia hlau (cov ntsia hlau hauv lub thawv me me ntsuab). Tom qab ntawd, lob koj Txiv neej rau poj niam jumper cables thiab xaim lawv raws li hauv qab no:

GPIO 11 rau CH1

GPIO 12 rau CH2

GPIO 13 txog CH3

GPIO 15 rau CH4

GPIO 16 txog CH5

GPIO 18 txog CH6

GPIO 22 rau CH7

GPIO 7 rau CH8

HLOOV

GPIO 6 to CSY

GPIO 2 to TVV

Nco tseg: Ntawm SSR lub rooj tsavxwm, muaj ob daim GND's. Siv qhov ib sab ntawm VCC.

Tom qab ntawd koj yuav xav txiav 16 daim ntawm 16 lub ntsuas cua xaim (2 rau txhua ntawm 8 txoj hauv kev) thiab tshem tawm qhov kawg, kwv yees li 1/16 ntawm ib nti tawm. Tom qab ntawd ntxig rau sab tso tawm ntawm ssr lub rooj tsavxwm thiab kaw lub hau ntswj kom nruj (tsis nruj dhau).

Ua ntej peb mus txuas ntxiv muaj qee yam uas koj yuav tsum paub: ntawm phab ntsa qhov hluav taws xob muaj ob txheej ntsia hlau, ib qho tooj liab thiab ib qho nyiaj. Sab tooj yog rau lub zog, sab nyiaj yog rau hauv av. Tam sim no, yam koj xav ua yog coj tus xaim sab laug los ntawm channel ib thiab khiav nws mus rau lub hau ntswj sab saum toj ntawm sab tooj. Tom qab ntawd mus rau cov channel tom ntej thiab siv cov xaim sab laug thiab khiav nws mus rau hauv qab ntsia hlau ntawm tib sab. Rov ua dua kom txog thaum koj muaj yim lub xov hlau khiav mus rau lub qhov hluav taws xob.

Tom qab ntawd koj yuav tsum ua cov xov hlau hauv av. Txiav ib daim ntawm 16 lub ntsuas cua xaim thiab txheeb ntawm daisy saw lub qhov hluav taws xob thaj chaw ua ke. Txhawm rau ua qhov no txuas ib lub xaim rau cov ntsia hlau nyiaj sab saud thiab tom qab ntawd mus rau hauv qab cov ntsia hlau nyiaj ntawm qhov hluav taws xob tom ntej. Tom qab ntawd koj yuav tsum xaus nrog ib lub xov hlau hauv av uas tsis txuas nrog. Muab koj ob lub qhov ntsaws ntsaws ntsaws thiab ib qho txuas los yog crimp cov xov tsis zoo ua ke.

Tam sim no, lob koj 10 channel fais fab tsheb npav. Koj yuav tsuas xav tau 9 txoj hauv kev. Daisy saw 9 ntawm lawv ua ke (tib sab). Tom qab ntawd coj txoj cai xaim los ntawm cov channel ib ntawm SSR pawg thawj coj saib thiab txuas nws mus rau thawj qhov siv. Ua qhov no kom txog thaum tag nrho 8 cov xov hlau txuas rau lub npav npav. Tom qab ntawd nqa cov xaim zoo los ntawm ob lub zog ntsaws ntsaws ntsaws thiab khiav nws mus rau qhov kawg ntawm kab tsheb npav.

Tam sim no qhov nyuaj tau dhau lawm!

Kauj Ruam 3: Teeb Raspberry Pi

Rau cov ntawm koj uas tshiab rau Raspberry Pi pib ntawm no:

Muaj ob peb qhov program koj yuav tsum rub tawm ua ntej peb pib teeb tsa. Rau txhua qhov txuas hauv qab no, xaiv koj li OS rau rub kom raug.

- Raspberry Pi Imager

www.raspberrypi.org/downloads/

- PuTTy

www.chiark.greenend.org.uk/~sgtatham/putty…

- SD daim ntawv tsim tawm

www.sdcard.org/downloads/formatter/

- Advanced IP Scanner

www.advanced-ip-scanner.com/download/Advan…

Thaum koj muaj cov rub tawm, pib los ntawm ntsaws koj daim npav SD. Qhib daim npav SD daim ntawv thiab xaiv lub zog uas koj xav kom ua. Tom qab ntawv format daim npav. Qhov no tsuas yog kev ceeb toom txhawm rau pab ua kom tag cov txheej txheem mus du dua.

Tom qab ntawd, rub tawm NOOBS OS system rau raspberry pi ntawm no:

downloads.raspberrypi.org/NOOBS_latest

Nco tseg: Vim li cas kuv xaiv NOOBS hla Raspberry Pi OS yog vim NOOBS muab txoj hauv kev rov qab sai yog tias koj xav tau kev teeb tsa tshiab.

Thaum qhov ntawd ua tiav, qhib qhov program raspberry pi imager, nqes mus rau qhov kev cai os, nrhiav NOOBS.zip, xaiv tus tsav koj xav sau koj li rau, thiab sau!

Tom qab ua tiav lawm, ntxig daim npav SD rau hauv lub qhov ntawm tus pi. Feem ntau ntawm cov uas nyob hauv qab lub rooj tsavxwm, tawm tsam usb chaw nres nkoj. Koj tseem yuav xav ntsaws nas rau raspberry pi rau lub sijhawm. Txuas lub micro USB fais fab mov rau hauv rpi. Tom qab ntawd siv HDMI ntsaws rau hauv TV, PC Monitor, thiab lwm yam. Tom qab qee lub sijhawm, raspberry pi yuav qhia koj sai sai, nug koj tias OS koj xav nruab. Xaiv thawj qhov kev xaiv (Raspberry Pi OS Full/Desktop). Tso cai rau nws los teeb tsa lub operating system thiab tom qab ntawd nws yuav rov pib dua pi. Ua raws li cov lus qhia pop-up los hloov kho koj tus pi thiab teeb tus password rau SSH (uas peb yuav siv tom qab).

Tom qab txhua qhov ua tiav, koj yuav xav nyem rau ntawm Raspberry Pi lub logo nyob rau sab saum toj sab laug. Tom qab ntawv los ntawm cov ntawv qhia zaub mov nco mus rau Preferences> Raspberry Pi Configuration. Qhov no yuav qhib cov ntawv qhia zaub mov nrog ntau qhov chaw rau koj Raspberry Pi. Nyem rau ntawm "Interfaces" tab thiab pab kom SSH.

Tom qab ntawd ntsaws rau hauv USB WiFi dongle rau ib qho ntawm USB chaw nres nkoj (yog tias koj tus pi tsis tau tsim hauv WiFi). Txuas rau koj lub network WiFi.

Thaum koj ua tiav qhov ntawd, mus rau koj lub khoos phis tawj nrog Advanced IP Scanner thiab PuTTy teeb tsa. Txuas mus rau tib SSID raws li koj txuas koj li Raspberry pi rau. Qhib Advanced IP Scanner thiab luam kab no: "192.168.137.1 - 192.168.137.254." Koj tus raspberry pi yuav tsum tshwm nrog tus IP chaw nyob ib sab ntawm nws. Tam sim no, qhib PuTTy thiab hauv lub Npe Lub Npe lub thawv ntaus tus IP chaw nyob uas pom tom ntej ntawm raspberry pi. Yuav muaj pop up, nyem yog. Tom qab ntawd koj yuav tau txais kev ceeb toom nrog "nkag mus rau hauv xws li:" ntaus "pi" thiab tom qab ntawd nkag tus password uas koj tau xaiv thaum koj teeb tsa koj tus pi. Thaum koj tab tom ntaus, koj yuav pom tias tus password yuav tsis tshwm. Qhov no yog kev nyab xeeb thiab yog ib txwm muaj. Tsuas yog ntaus tus password thiab ntaus nkag. Rau lwm cov lus nug, saib ntawm no:

www.raspberrypi.org/documentation/remote-a…

Thaum koj tau ua tiav nkag mus rau koj tus pi nyob deb, ntaus cov lus txib hauv qab no:

sudo apt nruab git-core

git clone

cd lightshowpi

git fetch && git checkout sej 3

sudo./install.sh

sudo rov pib dua

Tom qab txhua lo lus txib tos rau "pi@raspberrypi:" hauv cov ntawv ntsuab kom tshwm sim ua ntej ntaus tus lej tshiab hauv. Thaum uas ua tiav tag nrho, nkag mus rau qhov lus txib no txhawm rau sim kho vajtse:

sudo python py/hardware_controller.py -xeev = flash

Txhua lub teeb ntawm SSR lub rooj tsavxwm yuav tsum nyem ib tus zuj zus. Koj npaj tau khiav qee lub teeb!

Kauj Ruam 4: Ua Si Koj Thawj Zaj Nkauj

Txoj hauv kev yooj yim tshaj plaws uas kuv pom los ua nkauj yog rub cov ntawv.mp3 thiab tom qab ntawd muab tso rau hauv daim nplaub tshev ntawm raspberry pi. Kuv hu kuv lub suab paj nruag. Tom qab ntawd hauv PuTTy siv cov lus txib no:

sudo nab hab sej py/synchronized_lights.py --file =/home/pi/lightshowpi/usic/[songname].mp3

Qhov ntawd tsuas yog muaj rau nws! Nws yog qhov kev lom zem tiag tiag tab sis nyuaj txoj haujlwm thiab kuv vam tias qhov no yuav pab txhua tus neeg uas tau ntsib ib yam uas kuv tau ua. Nov yog qhov txuas rau YouTube playlist nrog kaw qee cov nkauj los ntawm kuv lub teeb pom kev.

www.youtube.com/playlist?list=PLusUu0mUL14inWN0n3kunZgV04VEoSOdA

Yog tias koj muaj lus nug, thov hu dawb! Ua tsaug!

Pom zoo: