Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Configure You Pi
- Kauj ruam 2: Ua Kev Sib Txuas
- Kauj Ruam 3: Kuaj Yog tias Kev Sib Txuas Ua Haujlwm Zoo
- Kauj Ruam 4: Kho Cov Xim thiab Teeb Los Ntawm Lub Vev Xaib
Video: Programmable Ambient Light rau Sab Nraud Zaub: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Txoj haujlwm no pab koj teeb teeb pom kev ib puag ncig rau koj lub saib sab nrauv lossis TV tso cai rau koj tswj cov hauv qab no los ntawm kev nplij siab ntawm txhua lub cuab yeej muaj lub vev xaib thiab txuas nrog koj lub router.
- LED Xim
- Zaus ntawm ntsais muag muab DJ cov nyhuv
- Teeb xim sib txawv rau txhua sab ntawm cov zaub
Khoom siv
WS2801 LED Sawb - 1X
Txuas Txuas
Raspberry Pi - txhua tus qauv
Lub Hwj Huam Sab Nraud
Kauj ruam 1: Configure You Pi
Khau koj lub PI thiab qhib lub npav SPI los ntawm kev ua raws cov lus txib hauv qab no.
sudo raspi-teeb tsa
Sau koj tus password yog hais kom sai. Tam sim no mus rau "Advanced Options" thiab pab kom SPI.
Tom qab ntawd, teeb tsa kev vam khom.
sudo apt-tau hloov tshiab sudo apt-tau nruab sej-pip -y sudo pip nruab adafruit-ws2801 sudo pip nruab flask
Kauj ruam 2: Ua Kev Sib Txuas
Tam sim no, nws yog lub sijhawm los ua cov xov hlau sib txuas
Txuas koj li 5V khoom siv sab nraud + mus rau kab txaij 5V thiab txuas cov khoom siv hluav taws xob hauv av rau PI hauv av thiab txuas nws mus rau kab txaij GND.
CK thiab SI yuav txuas nrog PI's SPI interface.
CK / CI: Tus Pin 23 (SCKL)
SI / DI: Pin 19 (MOSI)
Kauj Ruam 3: Kuaj Yog tias Kev Sib Txuas Ua Haujlwm Zoo
Tom qab txhua qhov kev sib txuas tau ua, nws yog lub sijhawm los sim peb cov kab txaij.
Tsim cov ntaub ntawv nab npawb tshiab.
nano./strip-test.py
Tam sim no, paste cov cai hauv qab no hauv nws, thiab khaws cov ntawv. Hloov qhov LED_COUNT tus nqi piv txwv li 32 nrog tus lej ntawm LEDs koj muaj ntawm koj daim kab xev.
lub sij hawm ntshuam
ntshuam RPi. GPIO li GPIO ntshuam Adafruit_WS2801 ntshuam Adafruit_GPIO. SPI li SPI # teeb tsa suav cov pixels: LED_COUNT = 32 SPI_PORT = 0 SPI_DEVICE = 0 pixels = Adafruit_WS2801. WS2801Pixels (LED_COUNT, spi = SPI. SpiDev, SPI_PEV, = GPIO) def rainbow_cycle (pixels, tos = 0.005): rau j hauv thaj tsam (256): # ib lub voj voog ntawm tag nrho 256 xim hauv lub log rau kuv hauv ntau (pixels.count ()): pixels.set_pixel (kuv, lub log (((i * 256 // pixels.count ()) + j) % 256)) pixels.show () yog tos> 0: time.sleep (tos) pixels.clear () pixels.show () rainbow_cycle (pixels, tos = 0.01)
Tam sim no koj cov hlua LED yuav tsum ci nrog txhua xim. Yog tias nws tsis yog, txheeb xyuas koj cov kev sib txuas thiab xyuas kom nws ua haujlwm ua ntej mus rau kauj ruam tom ntej.
Kauj Ruam 4: Kho Cov Xim thiab Teeb Los Ntawm Lub Vev Xaib
Tam sim no, nws yog lub sijhawm los teeb tsa lub vev xaib kom pab peb hloov kho cov xim sawb thiab ntsais muag los ntawm ib lub cuab yeej.
Clone cov cai.
git clone
Hloov kho cov suav suav hauv qhov sib txawv LED_COUNT hauv cov ntawv "led.py".
Nyob ntawm seb koj tsau cov LEDs rau koj cov zaub, hloov kho qhov hloov pauv hauv qab no hauv "rgbStrip.py" cov ntaub ntawv. STRIP_EXTRA, STRIP_BOTTOM, STRIP_RIGHT, STRIP_TOP, STRIP_LEFT
Khiav lub raj mis neeg rau zaub mov
sej./led.py
Tam sim no, qhib qhov browser ntawm ib qho ntawm cov khoom siv txuas nrog koj lub router thiab nkag mus rau IP chaw nyob ntawm koj tus PI nrog chaw nres nkoj 1234. Piv txwv li yog tus IP ntawm koj tus Pi yog 192.168.1.120, koj yuav tsum qhib https://192.168.1.120:1234 thiab koj yuav tsum pom lub vev xaib zoo ib yam li daim duab.
Tam sim no koj tuaj yeem xaiv xim rau txhua sab ntawm koj lub monitor
Pom zoo:
So Cov Khoom Siv Sab Nraud Sab Nraud ntawm Mac: 10 Kauj Ruam
So Cov Khoom Siv Sab Nraud Sab Nraud ntawm Mac: Txoj haujlwm no yog rau txhua tus uas xav tshem lub cim xeeb los ntawm lwm lub cuab yeej thaum siv Mac OS. Qhov no tuaj yeem ua tiav nrog tsuas yog lub khoos phis tawj siv Mac OS ntawm ib qho khoom siv sab nraud. Cov txheej txheem no yuav tsum siv sijhawm tsawg dua tsib feeb rau e
Lub Hwj Huam Sab Nraud Sab Nraud rau ESC: 3 Cov Kauj Ruam (nrog Duab)
Lub Hwj Huam Sab Nraud Sab Nraud rau ESC: Kuv tsim hluav taws xob skateboard thiab kuv xav tau ntxiv qhov hloov pauv sab nraud rau kuv ESC kom muaj peev xwm tso tag nrho kuv cov khoom siv hluav taws xob rau hauv tib lub thawv. Cov npe ib feem: -Pushbutton-Wire-shrinktube (yeem) -hotglue (yeem) -ESC (banggood: https://goo.gl/4n8kzB)
Ua Sab Nraud HDD Los Ntawm Sab Nraud Sab Nraud CD/RW: 5 Kauj Ruam
Ua Sab Nraud HDD Los Ntawm Sab Nraud Sab Nraud CD/RW: Zoo nkauj ncaj nraim rau kev hloov pauv ntawm lub qub sab nraud cd/rw mus rau qhov muaj txiaj ntsig sab nraud nyuaj tsav. Cov khoom siv 1-sab nraud cd/rw (tshwj xeeb tshaj yog cov boxy ntau dua) 1-hard drive (yuav tsum sib phim nrog cov txuas sab hauv ntawm cov ntaub ntawv tsav tsheb, yuav tsum tau ua qauv/sysed) 1-sm
Sab Nraud Sab Nraud Lub Koob Yees Duab Tso Tawm Tube Tube Rau Lwm Lub Hom Phiaj: 4 Kauj Ruam
Sab Nraud Sab Nraud Lub Koob Yees Duab Tso Tawm Tube Tube Rau Lwm Lub Hom Phiaj: Qee tus ntawm koj yuav paub nrog ntau yam lom zem uas koj tuaj yeem ua nrog Lub Koob Yees Duab Tso Tawm Lub Rooj Sib Tham. Ib qho ntawm cov khoom ntawd, teeb lub raj xa hluav taws xob sab nrauv los ntawm lub rooj tsav xwm hauv Circuit Court, tej zaum yuav muaj teeb meem rau koj. Yog vim li cas rau koj cov teeb meem
Tig Koj 12V DC lossis 85-265V AC Lub Teeb Hluav Taws Xob rau LED - Ntu 2 (Sab Nraud Sab Nraud): 6 Kauj Ruam
Tig Koj 12V DC lossis 85-265V AC Lub Teeb Hluav Taws Xob rau LED - Ntu 2 (Sab Nraud Sab Nraud): Nov yog Ntu 2 ntawm kuv cov lus qhia rau kev siv lub teeb ci ci, hloov nws mus rau LED, thiab ua rau nws pom ntau dua. Hauv Ntu 1 Kuv tau hla cov ntsiab lus sab hauv ntawm kev teeb tsa LEDs thiab ua rau lawv sib txuas. Hauv ntu no, Kuv wi