Cov txheej txheem:

DIY Arduino Tic Toc Toe Game: 6 Kauj Ruam (nrog Duab)
DIY Arduino Tic Toc Toe Game: 6 Kauj Ruam (nrog Duab)

Video: DIY Arduino Tic Toc Toe Game: 6 Kauj Ruam (nrog Duab)

Video: DIY Arduino Tic Toc Toe Game: 6 Kauj Ruam (nrog Duab)
Video: Привет, эмо 2024, Kaum ib hlis
Anonim
Image
Image

Tic Tac Toe game yog ob tus neeg ua si classic. Nws dhau los ua kev lom zem thaum koj ua si nrog koj cov menyuam, tsev neeg thiab cov phooj ywg. Ntawm no kuv tau qhia yuav ua li cas Tic Tac Toe game siv Arduino Uno, Laub khawm thiab Pixel LEDs. Qhov no Arduino raws 4 los ntawm 4 Tic Tac Toe zoo ib yam li Tic Tac Toe qub, tsuas yog qhov sib txawv yog X thiab O's tau sawv cev hauv ob qho xim sib txawv. kos qhov phiaj xwm no yog qhov 4 los ntawm 4 RGB Matrix nrog txhua lub pixel muaj lub laub khawm hauv nws. Yog tias lub pixel raug thawb ces nws yuav tsum teeb nrog nws cov xim txheej. Qhov kev ua si no tau teeb nrog ob xim Ntuj Xiav Xim sawv cev rau Player 1 thiab Xim Xim sawv cev rau Player 2. Yog tias tus neeg ua si yeej ces tag nrho cov LEDs yuav tsum ua kom muaj xim nrog tus neeg uas ua ntawv ntawd. Yog tias kev ua si yog kos ces txhua lub LEDs yuav tsum ua kom muaj xim liab. Tom qab ua tiav ib qho kev ua si, qhov kev ua si yuav tsum tau rov pib ua qhov ntawd peb muaj lub pob pib dua txuas nrog Arduino.

Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau:

3D Luam Ntawv
3D Luam Ntawv
  • Arduino Ib (1)
  • WS2812B LEDs lossis NeoPixel LEDs (16)
  • Laub Khawm (17)
  • 3.7V/5V Roj Teeb (1)
  • ON/OFF Hloov (1)
  • 3D Luam Tshooj

Kauj Ruam 2: 3D Luam Ntawv:

3D Luam Ntawv
3D Luam Ntawv
3D Luam Ntawv
3D Luam Ntawv
  • 3D luam tawm txhua qhov uas tau muab hauv qhov txuas hauv qab no.
  • 3D Luam 16 lub pob me me hauv PLA dawb thiab seem uas seem tuaj yeem luam tawm 3D hauv txhua xim uas koj xav tau.
  • Txuas rau STL Cov Ntaub Ntawv:
  • Tom qab luam tawm tag nrho cov ntu nruab tag nrho 16 lub khawm dawb hauv kab uas siv qee cov kua nplaum nrawm.

Kauj Ruam 3: Ua Push Buttons KeyPad:

Ua Push Buttons KeyPad
Ua Push Buttons KeyPad
Ua Push Buttons KeyPad
Ua Push Buttons KeyPad
  • Nqa ib daim duab los qhia, kos cov haujlwm nrog hwm 3D luam tawm ntawm daim duab los qhia.
  • Kuaj tag nrho 16 lub laub khawm ntawm daim duab los qhia ntawm txoj haujlwm.
  • Ua txhua qhov kev sib txuas los ntawm kev siv cov khawm khawm nrog kev pab ntawm qee cov xov hlau.

Kauj Ruam 4: Kev Sib Txuas Hauv Circuit:

Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
  • Txuas lub laub khawm keypad mus rau Arduino Uno raws li qhia hauv kab duab kab lus. (R1 ~ A0, R2 ~ A1, R3 ~ A2, R4 ~ A3, C1 ~ A4, C2 ~ A5, C3 ~ Pin 2, C4 ~ Pin 3).
  • Kuj tseem siv lub laub khawm ntxiv (Pib dua Khawm) thiab txuas rau Arduino. (Pib dua, GND).
  • Txuas txhua lub pixel LEDs. (-Ve/GND ~ GND, +Ve/5V ~ 5V, Cov Ntaub Ntawv Hauv ~ Pin 5).
  • Kuv tau siv WS2812b LEDs, Koj tuaj yeem siv cov hlua coj uas yuav yooj yim dua rau siv.
  • Txuas 3.7V/5V Roj teeb nrog ON/OFF Hloov.
  • Ntxig Tag nrho cov LEDs hauv txhua lub pob 3D luam tawm dawb, ib qho LED ntawm txhua lub khawm.

Kauj ruam 5: Code:

Txoj Cai
Txoj Cai
Txoj Cai
Txoj Cai
  • Qhib cov cai hauv Arduino IDE:
  • Nruab KeyPad lub tsev qiv ntawv thiab FastLED lub tsev qiv ntawv rau hauv Arduino IDE.
  • Txuas Arduino Uno rau koj lub PC.
  • Xaiv Pawg Hom thiab Chaw Nres Nkoj.
  • Upload cov cai.

Kauj Ruam 6: Cov Cai Ua Si:

Cov Cai Ua Si
Cov Cai Ua Si
Cov Cai Ua Si
Cov Cai Ua Si
Cov Cai Ua Si
Cov Cai Ua Si
Cov Cai Ua Si
Cov Cai Ua Si
  • Ntuj Blue sawv cev rau Player 1.
  • Pink sawv cev rau Player 2.
  • Cov neeg ua si yuav tsum tsis thawb lub pob uas twb raug thawb lawm.
  • Yog tias ib tus neeg twg uas yeej qhov matrix yuav ua rau nws cov xim.
  • Yog Game yog kos ces matrix yuav ua kom xim liab.

Pom zoo: