Cov txheej txheem:
- Kauj Ruam 1: Sau Cov Cheeb Tsam thiab Cov Cuab Yeej
- Kauj ruam 2: Ua daim phiaj
- Kauj Ruam 3: Ua Joystick
- Kauj Ruam 4: Sau Txoj Cai
- Kauj Ruam 5: Ua Si Nrog Koj Cov Phooj Ywg
Video: 3D4x Game: 3D 4x4x4 Tic-Tac-Toe: 5 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Koj puas nkees ua si ib yam, qub, tho txawv, 2-dimensional tic-tac-toe ?? Zoo peb muaj cov tshuaj rau koj! Tic-tac-ntiv taw hauv 3-qhov loj me !!! Rau 2 tus neeg ua si, hauv 4x4x4 lub voos xwmfab, tau txais 4 LEDs uake (hauv ib qho kev qhia) thiab koj yeej! Koj ua nws. Koj ua si nws.
Kauj Ruam 1: Sau Cov Cheeb Tsam thiab Cov Cuab Yeej
Qhov tseem ceeb tshaj plaws ntawm 3D Tic-Tac-Toe 3D yog LED. Peb tau xaiv PL9823 uas twb muaj cov tswj hwm sab hauv. Nws muaj plaub tus pin (Cov Ntaub Ntawv-hauv, Voltage-Supply, Hauv av, Cov Ntaub Ntawv-Tawm), thiab tso cai rau koj kom yooj yim nyob thiab tswj cov xim ntawm LED. Cov kab sib chaws tuaj yeem tsim ua ntau txoj hauv kev sib txawv, tab sis rau peb qhov no yog qhov pheej yig tshaj, ruaj tshaj plaws, thiab xaiv qhov zoo nkauj tshaj plaws.
Daim Ntawv Teev Npe:
- Arduino (peb siv Uno)
- PL9823 LEDs (tsawg kawg 64)
- Ntoo skewer sticks (ntev 24cm)
- Kev thaiv (peb siv sab hauv ntawm tus qub ethernet cable)
- Khawm (xeev xwm txheej)
- 7 Resistors (220Ohm)
- Breadboards (1 rau cov nyees khawm thiab ua si, 1 rau kev sib txuas yooj yim rau Arduino)
- Ua npuas ncauj polystyrene board (~ 2x30x30cm los ua vaj huam sib luag)
- Ua npuas ncauj polystyrene thaiv (~ 7x25x25cm raws li lub hauv paus rau txhua daim phiaj)
Daim Ntawv Teev Npe:
- Soldering hlau
- Soldering tin
- Kua nplaum
- Ncaj nrog tus kav
- Pliers
- Cov hlua hlau
- Hlau txiav
- Txiab
- Cim
- Cwj mem
- Tweezers
Kauj ruam 2: Ua daim phiaj
Peb ua 4 panels ntawm 4x4 LEDs ib tus zuj zus.
- 00: Tau txais styrofoam los ua vaj huam sib luag teeb tsa. Kos tus qauv. Hauv qhov no, peb siv 6cm sib nrug ntawm LEDs nrog 2cm ntawm qhov kawg.
- 01: Ntxig cov pins LED rau hauv styrofoam. Tseem ceeb! Nco ntsoov tias koj ntxig rau txhua lub LED nrog tib txoj kev taw qhia. Hauv peb qhov xwm txheej, peb tau xaiv tus pin tso rau sab laug.
- 02: Tam sim no tso cov pas nrig pas ntoo rau ntawm ob sab ntawm LEDs hauv kab, ua kom ntseeg tau tias cov ntsiab lus txhua lub ntsej muag zoo ib yam. Kua nplaum rau ntawm ob sab ntawm qhov muag teev LED thiab cia kom qhuav.
- 03: Ua tib yam rau txhua kab ntawm cov pas nrig pas ntoo ntawm ob sab ntawm LEDs, ua kom ntseeg tau tias cov ntsiab lus txhua lub ntsej muag zoo ib yam. Kua nplaum thiab cia kom qhuav.
- 04: Maj mam tshem tawm los ntawm xoob cov LEDs ib puag ncig. Nqa lub vaj huam sib luag tawm thiab ntxeev dua. Kua nplaum rau sab nraum qab kom nws muaj kev nyab xeeb dua.
- 05: Tom qab txhua yam qhuav, khoov tus pin kom ua kom yooj yim dua thiab pab kom tsis txhob muaj cov kab hluav taws xob hla hla. Peb siv lub tweezer thiab khoov tus pin los ze rau lub hauv paus.
- 06: Tam sim no npaj cov xov hlau. Peb siv cov xov tooj cua ethernet qub uas muaj 4-twisted-khub xov hlau sab hauv. Tshem cov rwb thaiv tsev ua tib zoo tsis txhob txiav cov xov hlau me. Tom qab ntawd tsis hloov pauv, xaiv koj cov xim kom sib haum rau cov kab sib txawv, thiab txiav mus rau qhov ntev ntawm txoj cai ntawm LEDs. Tom qab ntawd hle ib qho me me ntawm cov rwb thaiv tsev tawm ntawm qhov kawg. Peb xaiv hauv av = ntsuab, Vdc = xiav, cov ntaub ntawv hauv/tawm = dawb.
- 07: cog! Muaj ntau qhov kev sib txuas (64x4), yog li ceev faj kom muab tshuaj txhuam kom raug.
- 08: Tshem lub vaj huam sib luag, thiab tso rau ntawm lub hauv paus ua npuas ncauj!
Kauj Ruam 3: Ua Joystick
Peb tau siv lub khob cij los ua tus joystick rau kev siv kab sib chaws thiab ua qhov kev xaiv. Peb tso cov neeg dhia, cov neeg tawm tsam, thiab cov nyees khawm txhawm rau tsim lub Circuit Court (saib daim duab) uas piav qhia tus tswj kev tswj (6 nyees khawm, 1 rau txhua qhov kev taw qhia) thiab khawm xaiv (nkag mus rau tus neeg uas ua ntawv txav mus). 5V thiab hauv av tau txuas nrog cov chaw nres nkoj txheeb ze ntawm Arduino. Rau cov analog thiab cov lej nkag peb tau xaiv Arduino cov chaw nres nkoj A5 thiab 2, feem.
Kev xaiv khawm muaj cov txheej txheem yooj yim nrog rau kev tiv thaiv kev sib tsoo. Cov lus qhia kev coj ua yog ua raws tus tiv thaiv ntaiv uas ua haujlwm raws li kev faib hluav taws xob hluav taws xob: qhov hluav taws xob mus rau cov lus sib piv sib piv nyob ntawm qhov nias lub pob thiab txhais los ntawm Arduino ua ib qho kev hais kom ua.
Kauj Ruam 4: Sau Txoj Cai
Peb tau tshaj tawm peb cov cai rau koj siv:) Ua ntej, ua qhov txuas hluav taws xob mus rau Arduino. Peb muab lub khob cij me me tso rau ntawm Arduino kom yooj yim dua. Peb txuas Arduino "GND" thiab "5V" rau 2 kab ntawm breadboad qhov uas peb tom qab ntawd ntsaws rau hauv av thiab Vdc los ntawm txhua lub vaj huam sib luag. Txog Cov Ntaub Ntawv-Hauv thiab Cov Ntaub Ntawv-Tawm peb xaiv 4 qhov sib txawv Arduino pins, 13, 10, 7, thiab 4 rau txhua lub vaj huam sib luag. PL9823 LEDs tuaj yeem hais qhia tus kheej los ntawm tus lej xaj ntawm LED hauv koob. Piv txwv li, yog tias koj xav tig 1st LED rau qee yam xim, hais txog LED [0]. Rau lub 16 LED, chaw nyob LED [15]. Tam sim no koj npaj txhij rau cov lej thiab ua si nrog lub teeb zoo nkauj! Hauv qab no yog kev piav qhia dav dav ntawm cov cai ntawm 3D tic-tac-toe game.
Txoj Cai ntawm 3D4x Game
Peb siv lub tsev qiv ntawv fastled.h uas tso cai rau peb los tswj cov micro-LEDs tswj.
Lub voos xwmfab tau cim tau zoo hauv 3D cov lej sib xyaw "TTTMap", qhov twg txhua lub hauv paus tuaj yeem nyob hauv 1 ntawm 5 lub xeev raws li lub teeb sib xws yog tus tswv: 0 = tsis muaj tus neeg ua si, 1 = neeg uas ua ntawv 1, 2 = neeg uas ua ntawv 2, 3 = player 1 hauv kev sib tw yeej, thiab 3 = player 2 hauv kev sib tw yeej. Txhawm rau txhawm rau qhia cov ntsiab lus ntawm lub voos xwmfab virtual hauv TTTMap rau cov LEDs tiag, cov lej suav nrog LEDMap0, LEDMap1, LEDMap2, LEDMap3 tau siv.
Qhov "teeb tsa" ua haujlwm pib Arduino cov chaw nres nkoj txuas nrog lub vaj huam sib luag, pib ua ntej txhua lub LEDs rau "dub", thiab pib ua lub ntsiab ntawm TTTMap array rau 0.
Txoj haujlwm "voj" ua haujlwm "ReadButtonInput ()", "SendLED ()", thiab, yog tias ib tus neeg ua si yeej, ua haujlwm "VictoryAnimation ()". Thawj qhov muaj nuj nqi nyeem cov lus sib piv ntawm cov lus txib thiab cov tswv yim digital ntawm khawm xaiv. Cov boolean hloov pauv "ButtonPushed" thiab "SelectPushed" tau siv los txhawm rau zam kom tsis txhob txav mus los ntau zaus ntawm lub voj nrawm thaum khawm khawm. Lub luag haujlwm "SendLED ()" rov kho cov xwm txheej LED los ntawm kev xa cov teeb liab tswj raws li cov ntaub ntawv hauv TTTMap. Lub luag haujlwm tseem ceeb yog "CheckVictory ()" uas hu los ntawm "ReadButtonInput ()" txhua lub sijhawm xaiv lub pob raug thawb. Qhov kev ua haujlwm no txheeb xyuas yog tias cov ntsiab lus xaiv hauv qhov chaw ua kom muaj kev sib tw nrog cov pins puag ncig. Yog tias yeej qhov sib tw, cov ntsiab lus hauv TTTMap tau kos npe nrog tus lej 3 lossis 4, raws li tus neeg uas ua ntawv uas yeej, thiab zoo siab "VictoryAnimation ()" khiav!
Ua si dua, tsuas yog ntaus lub khawm pib dua ntawm Arduino:)
Kauj Ruam 5: Ua Si Nrog Koj Cov Phooj Ywg
Tsis muaj kev piav qhia ntawm no xav tau … YUAV TSUM!
Pom zoo:
YADPF (YET Lwm Tus Duab Duab Duab): 7 Kauj Ruam (nrog Duab)
YADPF (YET Lwm Tus Duab Duab Duab): Kuv paub qhov no tsis yog khoom tshiab, Kuv paub, Kuv tau pom qee qhov ntawm cov haujlwm no ntawm no, tab sis kuv ib txwm xav tsim kuv tus kheej cov duab thav duab. Txhua daim duab thav duab kuv tau pom yog qhov zoo, tab sis kuv tab tom nrhiav lwm yam, Kuv tab tom nrhiav qhov zoo nkauj tiag tiag
Kev Tsim Qauv Duab Duab/Duab Duab Duab: 4 Kauj Ruam
Kev Tsim Qauv Duab Duab/Duab Duab Duab: Nyob zoo txhua tus, Hauv qhov kev qhia no, Kuv yuav qhia koj cov txheej txheem ntawm yuav ua li cas thiaj tsim 3D qauv siv cov duab digital. Cov txheej txheem hu ua Photogrammetry, tseem hu ua Image-Based Modeling (IBM). Tshwj xeeb, hom txheej txheem no tau siv los rov ua dua
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