Cov txheej txheem:
- Kauj Ruam 1: Koj Xav Tau Dab Tsi?
- Kauj Ruam 2: Kev Tawm Tsam Sai
- Kauj Ruam 3: Ua Casing
- Kauj Ruam 4: Ua LED Matrix
- Kauj Ruam 5: Sau Cov Game Game Codes thiab Debugging Hardware
- Kauj Ruam 6: Muab Txhua Yam Ua Ke
Video: Stackers Arcade Game: 6 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Nyob zoo cov neeg, hnub no kuv xav qhia rau koj txog qhov kev ua si arcade zoo uas koj tuaj yeem ua nrog ib pawg Ws2812b LEDs thiab microcontroller/FPGA. Behold Stack Overflow - peb siv kho vajtse ntawm cov game arcade classic. Dab tsi pib ua haujlwm hauv tsev kawm ntawv sai dhau los ua haujlwm ntawm kev hlub thaum peb pib siv sijhawm ntau thiab ntau dua hauv kev txhim kho peb cov kev ua si thiab kawm paub ntau ntxiv los ntawm nws (thiab tsis quav ntsej peb kev kawm hauv txheej txheem xD). Thaum kawg, peb qhov kev ua si tau zoo thiab tau txais zoo los ntawm peb lub tsev kawm ntawv uas nws tau raug txeeb mus (raws li cov khoom siv ua piv txwv rau cov tub ntxhais kawm tom ntej). Zoo, peb ib txwm tuaj yeem tsim qhov thib ob. Cia peb pib!
Online game version:
Kauj Ruam 1: Koj Xav Tau Dab Tsi?
Cov ntaub ntawv:
1. tus Microcontroller/Microcomputer/FPGA - FPGA yog siv los ua qhov laj thawj ntawm peb qhov kev ua si. Xaiv koj lub rooj tsavxwm, rau peb txoj haujlwm peb yuav tsum tau siv Mojo FPGA board. Rau cov tsis tau pib, nws yog hom pawg thawj coj uas siv kho vajtse los siv nws lub luag haujlwm ntau dua li cov lej. Vim li no, Kuv yuav hais nws qis dua qib thiab sib txawv dua li yog tias koj siv Arduino lossis Pi. Yog tias koj siv lwm cov laug cam, koj yuav tsum sau koj tus kheej txoj cai, tab sis qhov kev ua si no yooj yim zoo nkauj rau tus lej thiab hav! Tam sim no koj tuaj yeem kawm paub coding ib yam nkaus!
2. Ws2812b LEDs - Ntawm no peb tab tom siv LEDs los tsim cov zaub rau peb cov game. Tsis tuaj yeem ua tus tsim yog tias koj tsis tau kov Ws2812b ua ntej xD. Nws yog tib lub ntsiab lus uas koj tuaj yeem txiav tawm ib qho LEDs thiab muab tso rau hauv txhua qhov kev tsim uas koj nyiam. Thiab nws yog RGB lub ntsiab lus uas koj tuaj yeem tso tawm cov xim uas koj nyiam. Tsis tas li ntawd, FastLED - Arduino lub tsev qiv ntawv rau kev tswj Ws2812b tau tsim tau zoo heev. Kuv xav kom tib neeg siv Arduino hloov chaw ntawm FPGA yog tias koj tsis muaj. Koj tuaj yeem yuav cov LEDs los ntawm Taobao/Amazon tab sis peb yuav peb li ntawm Sim Lim ntauwd hauv Singapore.
3. Ntoo-Rau sab nrauv peb siv 1cm-tuab plywood thiab rau LED matrix peb siv 0.3cm-tuab plywood. Peb pom peb cov khoom siv ntoo seem los ntawm peb lub tsev kawm ntawv lub lab zoo.
4. Lub teeb diffusing Acrylic - Rau peb lub vijtsam, peb tau sim ntau hom acrylic thiab peb pom qhov no frosted acrylic hu ua PL -422 uas yog qhov zoo heev rau diffusing teeb. Yog tias koj tsis tuaj yeem pom tus qauv qhia tseeb sim saib rau frosts acrylics. Peb yuav peb li ntawm Dama Plastics hauv Singapore.
5. Ua Npuas Ncauj Board - Txhawm rau cais txhua tus tib lub pixel ntawm lub teeb, peb xav tau cov qauv kab sib chaws thiab cov npuas no yog cov khoom siv zoo tshaj plaws los ua li ntawd. Peb tau yuav 0.5cm-tuab ua npuas ncauj ntawm peb lub tsev kawm ntawv phau ntawv muag khoom.
6. Lub Pob Loj Loj - Ok, nws tsis tsim nyog rau peb kom muaj lub pob liab liab loj tab sis nws ib txwm zoo kom muaj lub pob rau tib neeg ntaus! xD Peb yuav nws ntawm Sim Lim ntauwd hauv Singapore.
Cov Cuab Yeej:
1. Ntoo Kua nplaum
2. Soldering Hlau
3. Cov laug
4. Cov xov hlau. Nws zoo tshaj yog tias koj muaj cov xov hlau mos muag piv rau cov uas tawv dua. Thiab ib leeg tub ntxhais piv rau multicore.
5. Hlau stripper
6. Hlau txiav
7. Laum nrog 1mm laum ntsis
8. Scroll pom
9. Band pom
Kev debugging:
1. Cov Khoom Siv Hluav Taws Xob Hloov pauv
2. Oscilloscope
Kauj Ruam 2: Kev Tawm Tsam Sai
Rau peb txoj haujlwm, peb ua haujlwm sai sai ua ntej tsim peb cov lej LED thiab tsim peb cov game. Qhov laj thawj ua li ntawd yog tias peb tsis xav tsim LED matrix tsuas yog kom paub peb cov lej tsis ua haujlwm lossis peb cov kev ua si tsis raug yog qee txoj hauv kev.
Ntawm qhov kho vajtse sab, ntawm thawj theem peb tsuas yog sim peb cov laj thawj ntawm kev hloov pauv lub teeb pom kev ntawm peb tus kheej cov lej LED yooj yim. Thaum peb sim tias lub logic ua haujlwm tau zoo, tom qab ntawd peb tau tawm mus txiav cov kab ntawm 5 Ws2812b LEDs tsuas yog los sim peb cov kev ua si logic nrog kab sib txawv. Thaum qhov ntawd ua haujlwm tawm, peb mam li pib tsim cov LED matrix ntawm qhov ntsuas tag nrho.
Peb kuj tau sim tawm cov qauv acrylics sib txawv nrog cov LED ua ntej txiav txim siab rau PL-422 ua qhov pom kev zoo tshaj plaws. Thiab rau cov qauv sib cais peb kuj tau sim tawm qhov siab sib txawv rau LED kom nthuav dav. Thaum kawg peb pom 3cm*3cm square nrog 4cm qhov siab los ua qhov zoo tshaj plaws rau kev nthuav tawm. Raws li qhov kev pom zoo me me no, peb kuj txiav txim siab dab tsi yog qhov loj ntawm plywood xav tau rau 5 x 11 LED matrix los ntawm kev tso 0.5cm qhov sib txawv rau ua npuas dej ntawm cov xwm txheej.
Ntawm software sab, peb sim ua kom hloov pauv tau ntau li ntau tau - peb xub ntsuas seb LEDs tuaj yeem tso tawm ua ntej txuas ntxiv mus rau kev hloov pauv, thiab tom qab ntawd lwm qhov. Cov txiaj ntsig tuaj yeem ua rau muaj kev puas tsuaj yog tias koj tsis ua qhov no. Peb tau kawm qhov no nyuaj raws li peb tau sim coding tawm tag nrho cov game hauv ib qho loj ua ntej paub tias peb tsis tuaj yeem debug nws. Ouch!
Kauj Ruam 3: Ua Casing
Rau peb lub casing, peb mus nrog cov tshuab arcade zoo nkaus li thiab zoo li. Ua ntej, peb txiav qee cov plywood nyias kom sai ua qauv zoo li nws yooj yim dua thiab nrawm dua los txiav cov plywood nyias thiab kuaj. Thaum peb txaus siab rau peb qhov ntev thiab cov duab, peb pib siv cov plywood tuab los tsim lub casing. Peb siv cov hlua pom los txiav los ntawm cov plywood uas tuab dua thiab daim ntawv txiav kom txiav los ntawm cov uas nyias nyias. Tom qab ntawd, peb siv ntoo nplaum los ua kua nplaum ua ke.
Rau sab nraum ntawm cov plywood, peb xav kom nkag tau yooj yim cov khoom siv hluav taws xob sab hauv ntawm qhov no peb ua nws mus rau hauv qhov xauv qhov chaw uas koj tuaj yeem tshem tawm tau yooj yim thaum twg koj xav tau.
Txhawm rau txuas lub pob, peb xub kos lub voj voog qhov loj me ntawm lub pob microswitch txoj kab uas hla (hauv qab ntu ntev ntawm lub pob). Tom qab ntawd peb tau ua ib lub qhov nyob ze ntawm ntug thiab siv daim ntawv pom kom pom lub voj voog hla. Tom qab ntawd peb tso lub pob thiab ntsia nws rau hauv.
Peb kuj txiav ib qho me me ntawm plywood raws li lub hauv paus ntawm peb cov LED matrix raws li qhov ntau thiab tsawg uas peb tau suav ua ntej.
Nco tseg: Kuv thov txim uas tsis muaj txheej txheem ua ntu zus. Peb tsis tau sau cov kauj ruam txhua txoj hauv kev thiab los ntawm lub sijhawm peb pom tias peb yuav tsum tau sau cov kauj ruam, cov ntaub ntawv twb ua tiav lawm. Daim duab kuj tseem tsis yog qhov ntev kawg.
Kauj Ruam 4: Ua LED Matrix
Siv daim nyias nyias uas peb txiav tawm ua ntej, peb xub cim tawm txoj haujlwm ntawm txhua tus LED los ntawm kev kos ib lub xwmfab raws li peb tus qauv ua npuas ncauj thiab kos tus ntoo khaub lig nyob nruab nrab ntawm lub xwmfab raws li qhov chaw uas peb yuav tsum lo LED. Tom qab ntawd peb kuj tau laum 3 qhov me me ntawm txhua sab ntawm LED rau cov xov hlau kom dhau los thiab muab lawv txhuam rau txhua LED.
Peb daisy-saw txhua kab ntawm LED los ntawm lawv Cov Ntaub Ntawv Hauv thiab Cov Ntaub Ntawv Tawm pins thiab peb muab txhuam txhua GND thiab VCC rau ib qho xaim. Cov Thawj Cov Ntaub Ntawv Hauv yuav tsim cov qauv teeb rau txhua kab thiab peb txuas nws mus rau qhov pinout ntawm microcontroller/FPGA. Koj tseem tuaj yeem muab cov ntaub ntawv kawg tawm ntawm ib kab mus rau cov ntaub ntawv ua ntej ntawm lwm kab. Txoj hauv kev Ws2812b LED ua haujlwm yog tias txhua LED muaj IC uas yuav siv cov ntaub ntawv xav tau los ntawm xaim thiab hla qhov seem hauv cov saw. Peb ua raws peb cov LED ntawm lwm qhov Qhia Zoo (Qhov tseeb, peb tau theej nws raws nraim! XD)
Ntawm no peb kuj tseem xav hais txog qhov tseem ceeb ntawm kev siv cov xov hlau mos. Yog tias koj siv nruj, cov xov hlau nyuaj rau tus Thawj Coj Cov Ntaub Ntawv Hauv tus pin, dab tsi tshwm sim yog txhua lub sijhawm koj rub rau ntawm cov hlau nws yuav rub tawm tooj liab pluaj rau ntawm koj Ws2812b uas yuav ua rau nws puas tsuaj. Hauv txoj haujlwm no, ua ntej peb hloov mus rau cov xov hlau mos, peb tau rhuav tshem tag nrho 40 LEDs uas yog 1/3 ntawm LEDs xav tau rau peb tes haujlwm.
Qhia:
Kauj Ruam 5: Sau Cov Game Game Codes thiab Debugging Hardware
Mojo khiav ntawm Lucid HDL, uas tsis yog hom lus nrov tshaj plaws nyob rau ntawd. Peb tsis tuaj yeem pom Ws2812b LED tsev qiv ntawv hauv Lucid li no peb tau sau los sau peb tus kheej lub tsev qiv ntawv, uas yog qhov kev paub zoo heev. Txhawm rau ua qhov ntawd, peb xub tshuaj xyuas lub teeb liab uas dhau los ntawm kev siv Arduino's FastLED lub tsev qiv ntawv thiab sau cov lej kom rov ua qhov ntawd. Nov yog qhov ua kom yuam kev ntawm kho vajtse debugging, oscilloscope zoo heev, muaj txiaj ntsig zoo los txheeb xyuas cov cim, yog nws debugging koj tus kheej lub teeb liab uas koj tsis paub meej lossis txheeb xyuas thiab luam lwm cov cim.
Tom qab sau lub tsev qiv ntawv rau Ws2812b, peb mam li txuas mus rau tus lej rau qhov kev ua si, peb tau siv Bit hloov ua haujlwm kom txav txhua qhov thaiv mus rau sab laug thiab rau sab xis thiab siv Bitwise THIAB rau THIAB cov xwm txheej ntawm txhua kab rau kab ua ntej. Koj tseem tuaj yeem xav txog kev ua raws li hauv Arduino, uas yuav tsum tsis txhob nyuaj li ntawd. Peb txawm tias coded game screens rau kev lom zem ntawm nws!
Peb qhov kev ua si muaj 2 qib, uas yog pom kev sib tw ua si (Ntsuab) thiab qib thib ob tsis pom kev sib tw ua si (Xiav).
Txawm hais tias tom qab peb muaj cov lej ua haujlwm thiab ua haujlwm LED cov lej, qee zaum peb tseem ntsib teeb meem xws li teeb ci lossis teeb pom kev zoo thaum lawv tsis tsim nyog. Qhov teeb meem feem ntau yog vim qhov tsis zoo hauv av, qib fais fab lossis cuam tshuam. Nov yog qhov uas koj yuav xav tau lwm yam cuab yeej siv debugging cov cuab yeej xws li cov khoom siv sib txawv ntawm lub zog los txheeb xyuas seb Mojo/Arduino lub zog muab khoom txaus los yog siab dhau. Hauv kuv qhov kev paub, Ws2812b muaj ntau yam zoo ntawm kev ua haujlwm hluav taws xob los ntawm 2.8v - 5v. Ntawm no kuv muaj daim vis dis aus uas qhia pom lub teeb mus tas li tom qab kuv nce lub zog.
Txawm li cas los xij, kev tshuaj xyuas ntxiv qhia tias peb muaj qee qhov tsis zoo, tom qab rov muab lawv dua ib zaug ntxiv, peb cov teeb meem raug daws. Tseem yuav muaj teeb meem nrog cuam tshuam lossis hla kev tham, tab sis ua tsaug txaus, peb yeej tsis tau ntsib ib qho ntawm lawv.
Github cov lej:
Arduino Bitwise Shift:
Arduino Bitwise THIAB:
Kauj Ruam 6: Muab Txhua Yam Ua Ke
Koj muaj lub casing thiab LED matrix. Tam sim no yog lub sijhawm los muab txhua yam ua ke. Ua ntej peb tso cov npuas ua ntej thiab LED matrix qab nws thiab kho txoj haujlwm. Vim tias ua npuas dej muaj kev sib txhuam siab heev nws tsuas yog kev sib txhuam sib dhos thaum lub LED matrix kub glued hauv qhov chaw. Tom qab ntawd peb muab lub vijtsam tso rau ntawm xub ntiag. Peb mam li txuas txhua kab tus pin rau lub microcontroller thiab pib ua si!: D
Ib yam kuv nyiam txog txoj haujlwm no yog nws hloov pauv tau, koj ib txwm tuaj yeem rov tsim dua lub microcontroller los ua ib feem ntawm lwm qhov kev ua si thiab sim qee yam xws li ua cov duab ua si lossis cov tshuaj tiv thaiv. Vam tias koj nyiam ua qhov no thiab kawm qee yam los ua qhov no. GgEz!
Pom zoo:
Platformer Nrog Qib Tsis Txaus ntawm GameGo Nrog Makecode Arcade: 5 Cov Kauj Ruam (nrog Duab)
Platformer Nrog Qib Tsis Txaus Ntsig ntawm GameGo Nrog Makecode Arcade: GameGo yog Microsoft Makecode tau tshaj retro gaming portable console tsim los ntawm TinkerGen STEM kev kawm. Nws yog raws STM32F401RET6 ARM Cortex M4 nti thiab ua rau STEM cov kws qhia lossis tsuas yog cov neeg uas nyiam muaj kev lom zem tsim retro video game
Cov Duab Duab Duab thiab Cov Duab 1: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Cubes thiab Cov Duab 1: Thaum sim nrog qee cov ntoo ntoo thiab cov duab los qhia, kuv pom ob peb txoj hauv kev los ua cov voos thiab lwm yam duab los ntawm cov khoom siv yooj yim. Los ntawm kev muab cov no los ua Cov Ntawv Qhia, Kuv vam tias yuav txhawb nqa kev ua si thiab kev kawm. Kev hloov pauv ntawm qhov kev qhia no
Yuav Ua Li Cas Thiaj Li Tshem Tawm Lub Computer Nrog Cov Kauj Ruam Yooj Yim thiab Duab: 13 Kauj Ruam (nrog Duab)
Yuav Tsum Tshem Tawm Lub Khoos Phis Tawj Li Cas Nrog Cov Kauj Ruam Yooj Yim thiab Duab: Nov yog cov lus qhia txog yuav ua li cas tshem lub PC. Feem ntau ntawm cov khoom siv yooj yim yog hloov pauv thiab tshem tawm tau yooj yim. Txawm li cas los xij nws yog ib qho tseem ceeb uas koj tau koom nrog nws. Qhov no yuav pab tiv thaiv koj kom tsis txhob poob ib feem, thiab tseem ua rau kev rov ua dua tshiab
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: Nov yog txoj hauv kev yooj yim heev thiab tus nqi qis mus rau cov duab thav duab digital - nrog qhov zoo ntawm kev ntxiv /tshem cov duab hla WiFi ntawm 'nyem thiab luag' siv (pub dawb) xa cov ntaub ntawv . Nws tuaj yeem siv tau los ntawm qhov me me 拢 4.50 Pi Zero. Koj tseem tuaj yeem hloov pauv
Arcade Game Machine Nrog Raspberry Pi: 7 Kauj Ruam (nrog Duab)
Arcade Game Machine Nrog Raspberry Pi: Ua zaj dab neeg: Arcade game tshuab nrog retro pi (raspberry pi3)