Cov txheej txheem:
- Kauj Ruam 1: Laser Txiav
- Kauj ruam 2: Nruab LEDs
- Kauj ruam 3: Sib dhos
- Kauj ruam 4: Soldering
- Kauj Ruam 5: Nruab SPI Zaub
- Kauj Ruam 6: Nruab Pi
- Kauj Ruam 7: Txuas thiab Fais Fab Khoom
- Kauj ruam 8: Teeb Pi
- Kauj Ruam 9: Python Code, Test thiab Simulator
- Kauj ruam 10: Kuaj zaum kawg thiab Veneer
- Kauj Ruam 11: Qhov tshwm sim
Video: Ntoo LED Gaming Zaub Powered los ntawm Raspberry Pi Zero: 11 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Txoj haujlwm no paub txog 20x10 pixel WS2812 raws li LED zaub nrog qhov loj ntawm 78x35 cm uas tuaj yeem yooj yim teeb tsa hauv chav nyob ua si retro games. Thawj qhov ntawm cov lej no tau tsim xyoo 2016 thiab rov tsim kho los ntawm ntau tus neeg. Qhov kev paub dhau los no tau siv los suav tag nrho txhua qhov kev txhim kho txhawm rau tsim qhov tshiab ntawm cov lej thiab coj qhov no tam sim no mus rau instructables.com. Cov yam ntxwv tseem ceeb tshiab yog hloov tshiab rau Raspberry Pi Zero hloov pauv siv thiab Pi A ntxiv rau Arduino thiab hloov pauv qhov kev tswj hwm loj yav dhau los nrog Bluetooth gamepad. Tsis tas li software tau txhim kho suav nrog kev sim, uas tso cai rau koj los tsim cov cai ntawm lub khoos phis tawj txawm tias koj tsis muaj kev nkag tau mus rau cov khoom siv matrix.
Ib qhov tshwj xeeb ntawm cov lej LED no yog cov ntoo tshwj xeeb veneer, uas yog siv los npog LED thiab kom nkaum lawv, thaum LEDs raug xiam oob qhab. Qhov no tau nce qhov kev lees paub ntawm cov neeg tsis yog thev naus laus zis;-) Tau kawg, yog tias cov veneer tshwj xeeb no tsis muaj nyob hauv koj lub tebchaws, koj kuj tseem tuaj yeem siv qee lwm yam khoom siv sib xws xws li acrylic los nkaum LEDs. Nws tseem tau npaj los muab qee qhov tseem ceeb rau yav tom ntej kom yooj yim dua los tsim txoj haujlwm.
Khoom siv:
- Raspberry Pi Zero W (nrog qee qhov kev hloov pauv, txhua lwm tus qauv kuj tseem yuav ua haujlwm)
- 200 LED/s (WS2812B LED kab txaij nrog 30 LED/m)
- 4x SPI LED matrix zaub nrog MAX7219
- Cov kab
- Bluetooth gamepad (piv txwv li qhov no los ntawm Pimoroni)
- Lub hwj chim muab 5V nrog tsawg kawg 5A
- MDF ntoo rau laser txiav
- Ntoo veneer lossis diffusion acrylic phaj
- Capacitor, resistor
- Ib co ntsia hlau
Kauj Ruam 1: Laser Txiav
Lub hauv paus txheej txheem ntawm matrix yog ua los ntawm MDF ntoo nrog tuab ntawm 3 hli thiab txiav los ntawm lub tshuab txiav laser. Yog tias koj tsis muaj lub tshuab txiav laser, koj tuaj yeem siv kev pabcuam online zoo li ponoko.com lossis formulor.de lossis tiv toj rau tom ntej fablab/makerspace hauv koj ib puag ncig. Nws kuj tseem tuaj yeem siv cov ntawv los sis lwm cov ntaub ntawv sib zog tab sis cov ntawv txuas tau tsim los rau 3mm tuab, yog li cov ntaub ntawv tuab dua lossis tuab dua xav tau rov tsim cov ntaub ntawv. Kev tsim qauv tau ua tiav hauv Fusion 360. Feem ntau ntawm cov ntu tuav ua ke tsuas yog zawv zawg lawv rau hauv qhov chaw, tsuas yog qee qhov zoo li cov ciam teb sab nrauv yuav tsum tau ua ke ua ke siv cov kua nplaum ntoo. Ua kom ntseeg tau tias koj cov lej ua haujlwm tau zoo ua ntej thov siv cov kua nplaum! Tsis tas li cov ntoo veneer yuav tsum tau lo rau, tab sis qhov no yog qib kawg tom qab ua kom ntseeg tau tias txhua yam ua haujlwm.
Ntawm sab xis (qis dua) ntawm lub dav hlau rov qab, muaj kev txiav tawm ntu kom ruaj ntseg cov khoom siv hluav taws xob mus rau qhov sib piv thiab tseem muaj kev nkag mus rau cov khoom siv no thaum cov veneer tau lo rau.
Kauj ruam 2: Nruab LEDs
Cov kab txaij LED yog tus qauv 30 LED/m WS2812 kab txaij, uas muaj nyob ntawm Amazon, eBay lossis lwm lub khw muag khoom online thoob plaws ntiaj teb. Qhov no ib txwm tseem yog qhov pheej yig tshaj plaws tuaj yeem hais qhia LED kab txaij muaj. Yog tias koj xav siv lwm LEDs, koj yuav tsum xyuas kom 30 LED/m nrug kom haum rau cov qauv matrix. The lasercutted segments tau txiav tawm thaj tsam me me kom haum rau LED dav ntawm 10 cm. Cov kab txaij LED no muaj daim kab xev ob sab ntawm lawv sab nraub qaum, yog li koj tsuas tuaj yeem lo lawv ncaj qha mus rau MDF tom qab tso qhov tseeb. Txheeb xyuas qhov tseeb ntawm txhua kab txaij ua ntej siv kab xev (DIN-DOUT kev taw qhia).
Cov qauv thaiv hluav taws xob yog zig-zag yog li qhov kawg, tsuas muaj ib tus pin nkag mus rau hauv cov lej thiab cov kab hluav taws xob ntev yog luv li sai tau. Txhawm rau faib lub hwj chim kom raug thiab txo cov cabling nyob rau sab saum toj ntawm cov lej, txhua kab txaij LED txuas nrog 5V thiab GND nyob hauv qab ntawm qhov sib piv. Koj tuaj yeem siv ib qho xov hlau lossis cov qauv PCBs los faib 5V thiab GND kab.
Kauj ruam 3: Sib dhos
Qhov tawg tawg pab pab txheeb xyuas qhov tseeb ntawm cov khoom sib dhos. Tsuas yog ua raws cov duab teeb tsa ib qib zuj zus. Lub dav hlau rov qab muaj cov qauv hla los tuav cov phab ntsa ntev thiab qee cov phab ntsa luv. Yog tias koj muaj teeb meem los teeb tsa daim, siv cov ntawv xuab zeb los kho nws.
Kauj ruam 4: Soldering
Muaj ntau txoj hauv kev los sib dhos muaj cov kab hluav taws xob rau cov kab sib txawv ua ke. Xwb koj tuaj yeem siv cov xov hlau ib leeg lossis qee yam ntawm txoj kev tsheb nqaj hlau tawm ntawm tooj liab los txhawm rau sib txuas cov xov hlau sib txawv. Hauv qhov no, ib daim qauv ntawm PCBs tau siv los taw qhia cov kab hluav taws xob mus rau kab txaij. WS2812B kab txaij twb muaj cov kab hluav taws xob sib cais uas koj tuaj yeem siv los txuas txoj kab hluav taws xob mus rau thawj kab txaij nkag (sab laug ntawm daim duab).
Kauj Ruam 5: Nruab SPI Zaub
Txhawm rau tso cov qhab nia game thiab cov ntawv, siv cov cim LED raws tus lej LED MAX7219 siv. Nws txuas nrog ntawm SPI (Serial Peripheral Interface) rau Raspberry Pi. Plaub plaub 8x8 cov lus sib xyaw ua ke rau 32x8 pixel dot matrix zaub. Koj tuaj yeem yuav qhov no 8x8 pixel qhia rau piv txwv. ntawm eBay, tseem muaj ua ke 32x8 pixel cov lus muaj. Tsis tas li koj muaj kev xaiv xim sib txawv; hauv qhov no cov lus liab tau siv. Vim tias SPI ua haujlwm zoo li kev hloov pauv rau npe, cov lus tau txuas nrog ua ke hauv xov tooj cua los ntawm kev txuas cov ntaub ntawv tawm ntawm thawj daim ntawv rau cov ntaub ntawv hauv qhov thib ob thiab yog li pib los ntawm sab xis ntawm cov zaub.
Cov zaub no tsuas yog nyeem tau los ntawm sab nraud, yog tias nws tau tso ncaj qha rau tom qab txheej veneer. Yog tsis yog, tsuas muaj qhov liab ploog pom xwb. Yog li koj yuav tsum tau teeb tsa nws nyob rau sab saum toj ntawm lub dav hlau rov qab txiav tawm nrog qhov nrug ntawm 30 hli nruab nrab ntawm qhov dav ntawm lub dav hlau rov qab thiab saum npoo ntawm lub ntsej muag. Kuv tau siv qee qhov seem hla cov ntoo thiab cov ntsia hlau los hloov qhov uas ploj lawm 19 hli nruab nrab ntawm lub dav hlau rov qab thiab PCBs, tab sis koj tseem tuaj yeem muaj lwm hom spacers sab nrauv.
Txoj hlua ntawm cov zaub tau qhia hauv qib 7.
Kauj Ruam 6: Nruab Pi
Hauv qhov kev teeb tsa no, siv Raspberry Pi Zero. Koj kuj tseem tuaj yeem siv lwm yam Raspberry Pi tus qauv, tab sis qhov tshiab dua nrog Wi -nkaus thiab Bluetooth tso cai rau koj yooj yim txuas rau wireless gamepads thiab ua kom yooj yim rau lub program. Koj tuaj yeem ruaj ntseg Pi los ntawm kev siv tsawg kawg ob lub ntsia hlau thiab lub qhov me me txhawm rau ntswj nws mus rau lub dav hlau.
Rau Raspberry Pi Zero W, cov pins hauv qab no tau siv:
- PIN 2: 5V
- PIN 6: GND
- GPIO18 -> LED kab txaij
- GPIO11: SPI CLK -> MAX7219 matrix CLK
- GPIO10: SPI MOSI -> MAX7219 matrix DIN
- GPIO8: SPI CS -> MAX7219 matrix CS
Qee tus neeg tshaj tawm cov teeb meem nrog kev siv GPIO18 rau LEDs. Thov siv GPIO21 hauv qhov no. Yog li, koj yuav tsum hloov txoj cai hauv kab 21 rau pixel_pin = board. D21.
WS2812B sawb tau siv ntawm no sab nraud nws qhov tshwj xeeb. Feem ntau nws xav tau 5V qib kev xav ntawm DIN, tab sis Pi tsuas yog muab 3, 3V. Txawm hais tias qhov no ua haujlwm nyob rau hauv feem ntau ntawm cov xwm txheej, koj yuav tsum ntsuas qhov no nrog koj cov hlua. Yog tias nws tsis ua haujlwm, koj tuaj yeem ntxiv qib hloov pauv zoo li 74HCT245 lossis lwm yam 3V3 txog 5V hloov pauv ntawm Pi thiab kab txaij.
Kauj Ruam 7: Txuas thiab Fais Fab Khoom
Kev xaim hluav taws xob tau ua tiav raws li cov phiaj xwm thaiv. Lub zog siv hluav taws xob yog 5V DC.
Txhawm rau kom yooj yim rau/tawm kev hloov pauv ntawm cov lej, hloov pauv tau ntxiv ntawm lub hwj chim ntsaws thiab cov xov tooj sib txuas. Txawm li cas los xij, vim tias Raspberry Pi tsis nyiam hloov pauv nyuaj, muaj qhov kev xaiv kaw hauv software kom nyab xeeb kaw Pi ntawm Gamepad ua ntej hloov pauv ntawm matrix.
Cov hlua LED DIN tus pin txuas nrog ntawm tus tiv thaiv rau Pi, kuj tseem muaj lub peev xwm loj (4700uF) ntxiv rau qhov tsis muaj zog. Thov txheeb xyuas Adafruit Überguide rau Neopixels kom paub meej ntxiv.
LEDs tau siv qhov siab tshaj plaws tam sim no ntawm 60mA rau ib qho LED, yog li qhov siab tshaj tam sim no ntawm 200x60mA = 12A yog ua tau !!! Los ntawm kev txo qhov ci ci thiab tsis siv txhua LEDs hauv dawb dawb, qhov no yog ntau qhov kev xav theoretical, tab sis nws nyob ntawm txoj cai uas qhov siab tshaj plaws tam sim no tau mus txog. Yog li xaiv lub hwj huam loj txaus yog qhov tseem ceeb heev. Rau feem ntau ntawm cov ntawv thov lub zog siv nrog 5V/5A (25W) yuav tsum txaus.
Txhawm rau kho lub dav hlau rov qab nrog Pi thiab Matrix zaub, qee cov ntoo me me tuaj yeem siv los tsoo lawv ntawm ntug thiab tseem siv cov ntsia hlau los tuav lub dav hlau rov qab rau hauv qhov chaw.
Kauj ruam 8: Teeb Pi
1. Rub tawm qhov tseeb Raspbian lite duab los ntawm raspberrypi.org
2. Luam nws rau thiab SD daim npav, 8GB yog txaus. Koj tuaj yeem siv piv txwv lwm yam los ua qhov no.
3. Ua ntej pib Pi nrog SD daim npav, npaj WIFI thiab ssh nkag
4. Ntxig daim npav SD mus rau txhua lub khoos phis tawj, khau raj nplaub tshev yuav tsum nkag tau yooj yim
5. Luam kab hauv qab no mus rau cov ntaub ntawv wpa_supplicant.conf (tsim nws yog tias tsis muaj) thiab hloov qhov tsis nyob ntawm koj li Wifi thiab cheeb tsam
ctrl_interface = DIR =/var/run/wpa_supplicant GROUP = netdev
lub teb chaws = US update_config = 1 network = {ssid = "Tsev Wifi" psk = "mypassword" key_mgmt = WPA-PSK}
6. Ntxiv cov ntaub ntawv khoob hu ua ssh (tsis muaj txuas ntxiv) rau khau raj kom pab ssh nkag tau
7. Tam sim no ntxig daim npav SD rau Raspberry Pi thiab khau raj nws. Txheeb xyuas koj lub router wifi kom tau tus IP chaw nyob ntawm Pi
8. pib SSH txuas rau Pi siv lub davhlau ya nyob twg (Linux, Mac) lossis piv txwv Rub tawm Windows. Ntxig tus IP ntawm Pi hloov chaw 192.168.x.y
9. Hloov kho Pi (siv sijhawm me ntsis!)
sudo apt-tau hloov tshiab
sudo apt-tau hloov tshiab
10. Nruab pip thiab teeb tsa cov cuab yeej
sudo apt-tau nruab python3-pip
sudo pip3 nruab -hloov kho setuptools
11. Nruab Neopixel tsav tsheb, ws281x lib, pygame thiab libsdl
sudo pip3 nruab rpi_ws281x adafruit-circuitpython-neopixel
sudo pip3 nruab pygame sudo apt-tau nruab libsdl1.2-dev sudo pip3 nruab-hloov kho luma.led_matrix
12. Pab kom SPI los ntawm kev hu raps-teeb tsa, mus rau 5 Kev Sib Txuas Xaiv / P4 SPI / Pab kom
sudo raspi-teeb tsa
13. Ntxiv Bluetooth Gamepad
sudo bluetoothctl cov
[bluetooth]# tus sawv cev ntawm [bluetooth]# pairable ntawm [bluetooth]# scan rau [bluetooth]# khub aa: bb: cc: dd: ee: ff [bluetooth]# ntseeg aa: bb: cc: dd: ee: ff [bluetooth]# txuas aa: bb: cc: dd: ee: ff [bluetooth]# tawm
qhov twg aa: bb: cc: dd: ee: ff yog MAC tiab ntawm koj lub bluetooth gamepad. Qhov chaw nyob no yuav tsum tau qhia tom qab hu rau "scan on" hais kom ua. Xyuas kom meej tias koj tus tswj hwm Bluetooth tau npaj ua khub, thov txheeb xyuas phau ntawv ntawm tus tswj hwm yuav ua li cas.
14. Tam sim no koj tuaj yeem txuas rau koj Pi ntawm, tus password tsis raug yog raspberry (Cov neeg siv Windows tuaj yeem siv Putty):
Kauj Ruam 9: Python Code, Test thiab Simulator
Code muaj nyob ntawm Github. games_pi_only.py thiab txhua cov ntaub ntawv bmp xav tau.
git clone href = https://github.com/makeTVee/ledmatrix/tree/master/python/pi_only
Cov cai muaj qhov kev xaiv los khiav hauv kev sim sim sab nraum Pi siv pygame los ua piv txwv cov lej. Qhov no yog qhov muaj txiaj ntsig zoo los txhim kho cov yam ntxwv tshiab yam tsis muaj kev nkag ncaj qha rau cov khoom siv matrix. Kuj debugging yog yooj yim dua. Koj yuav tsum teeb tsa PI tas mus li los qhib kev sim ua (Kab 15):
PI = Cuav
Hauv qhov kev sim no, siv Keyboard los hloov ntawm Bluetooth gamepad. Khawm 1, 2, 3, 4 tau teeb tsa rau A, B, X, Y ntawm gamepad, xub tuav rau cov lus qhia, "s" rau pib thiab "x" rau xaiv. Koj tuaj yeem siv tus txheej txheem hloov kho ntxiv rau lub console lossis qee qhov sib xyaw IDEs zoo li Micosoft Visual Studio Code lossis Jetbrain PyCharm los ua qhov kev txhim kho ntawm koj lub PC.
Yog tias koj siv cov lej thiab Raspberry Pi, koj yuav tsum txhais:
PI = Tseeb
Txhawm rau luam cov cai rau Raspberry Pi, koj tuaj yeem siv cov lus txib scp (Windows WinSCP). Qhib lub console qhov rai, hloov mus rau cov ntawv tais ceev tseg cov ntawv Github thiab hu
scp games_pi_only [email protected]:/home/pi
scp *.bmp [email protected]:/home/pi
tom qab ntawd txuas rau Pi ntawm ssh (Windows cov neeg siv tuaj yeem siv Putty):
tom qab ua tiav kev nkag mus, koj tuaj yeem pib tus nab npawb nab npawb los ntawm kev hu:
sudo python3 games_pi_only.py
Yog tias txoj cai sau kom raug, koj tuaj yeem pab kom pib pib dua los ntawm kev hu rau:
sudo nano /etc/rc.local
thiab ntxiv kab hauv qab no ua ntej tawm 0:
/usr/bin/zoo -n -20 python3 /home/pi/games_pi_only.py &
Txuag (Ctrl+O) thiab Tawm (Ctrl+X)
Kauj ruam 10: Kuaj zaum kawg thiab Veneer
Ua ntej cov veneer yog kua nplaum rau sab saum toj ntawm lub hauv ntej, lub matrix yuav tsum raug kuaj xyuas kom ntseeg tau tias tag nrho cov LEDs ua haujlwm. Nws yooj yim dua los kho qee yam ua ntej cov veneer tau lo rau.
Cov ntoo veneer siv yog daim ntawv tshwj xeeb maple veneer hu ua Microwood, uas yog ib sab npog nrog ntawv thiab muaj tuab ntawm 0, 1 hli. Sab ntawv tuaj yeem ua ncaj ncaj rau ntawm mdf siv cov txheej txheem dej dawb ntawv kua nplaum.
Kauj Ruam 11: Qhov tshwm sim
Muaj kev lom zem thiab txaus siab rau qhov kev ua si!
Qhov khoom plig loj hauv Raspberry Pi Contest 2020
Pom zoo:
Loj hlob Zaub Zaub Ntxiv Hauv Qhov Chaw Tsawg Los Yog Loj hlob Zaub Zaub Hauv Chaw, (Ntau lossis Tsawg): 10 Kauj Ruam
Loj Hlob Ntau Cov Zaub Zaub Hauv Tsawg Chaw lossis … Loj hlob Zaub Zaub Hauv Chaw, (Ntau lossis Tsawg).: Qhov no yog kev tshaj lij tshaj lij rau Kev Loj Hlob Tshaj Ntiaj Teb, Kev Tsim Khoom Sib Tw, xa los ntawm Cov Lus Qhia. Kuv tsis tuaj yeem muaj kev zoo siab dua los tsim rau thaj chaw cog qoob loo thiab tshaj tawm kuv thawj Cov Lus Qhia. Yuav pib, kev sib tw nug peb kom
Portable Bluetooth Speaker Ua Los Ntawm Ntoo Ntoo: 9 Kauj Ruam (nrog Duab)
Portable Bluetooth Speaker Ua Los Ntawm Ntoo Ntoo: Nyob zoo txhua tus, nws tau ntev lawm txij li kuv tau tshaj tawm zaum kawg ntawm no yog li kuv xav tias kuv yuav tshaj tawm kuv txoj haujlwm tam sim no. Yav dhau los kuv tau ua ob peb tus hais lus nqa tau tab sis feem ntau ntawm lawv tau tsim los ntawm yas/acrylic txij li nws yooj yim los ua haujlwm nrog thiab tsis xav tau
Yuav Ua Li Cas Siv Qhov Tsob Ntoo Tsob Ntoo Los Ua Ke Los Ua Ib Tug Ntoo Zoo Nkauj thiab Muaj Zog Ntoo: 10 Kauj Ruam
Yuav Siv Li Cas Ib Ntus Ntoo Los Ua Ke Los Ua Ib Tug Ntoo Zoo Nkauj thiab Muaj Zog: Lub npe ntawm caj npab neeg hlau yog WoodenArm. Nws zoo nkaus li ntxim hlub heev! Yog tias koj xav paub ntau ntxiv txog WoodenArm, thov xa mus rau www.lewansoul.com Tam sim no peb tuaj yeem qhia txog WoodenArm, cia peb txav mus
USB Powered Burner! Txoj haujlwm no tuaj yeem hlawv los ntawm Plastics / Ntoo / Ntawv (kev lom zem Project Tseem Yuav Tau Ua Ntoo Zoo): 3 Kauj Ruam
USB Powered Burner! Txoj haujlwm no tuaj yeem hlawv los ntawm Plastics / Ntoo / Ntawv (qhov haujlwm lom zem kuj tseem yuav tsum tau ntoo zoo heev): TSIS TXHOB siv qhov USB no !!!! Kuv pom tias nws tuaj yeem ua rau koj lub computer puas tsuaj los ntawm txhua cov lus pom. kuv lub computer zoo lawm os. Siv lub xov tooj charger 600ma 5v. Kuv siv qhov no thiab nws ua haujlwm tau zoo thiab tsis muaj dab tsi tuaj yeem raug puas tsuaj yog tias koj siv lub ntsaws ruaj ntseg kom nres lub zog
Zaub Lub Teeb Los Ntawm Lub Ntoo Ntoo: 9 Kauj Ruam (nrog Duab)
Zaub Lub Teeb Los Ntawm Lub Ntoo Ntoo: Kuv tus poj niam thiab kuv muab kuv Niam rau iav iav duab puab rau Christmas. Thaum kuv Niam qhib nws kuv tus tij laug tau xa nrog "RadBear (zoo nws tau hais kuv lub npe) tuaj yeem tsim lub thawv rau koj!" Nws hais qhov no vim tias raws li ib tus neeg uas khaws iav kuv