Cov txheej txheem:

Tic Tac Toe: 12 Kauj Ruam
Tic Tac Toe: 12 Kauj Ruam

Video: Tic Tac Toe: 12 Kauj Ruam

Video: Tic Tac Toe: 12 Kauj Ruam
Video: Tic Tac Toe- Tic Tac Toe 2024, Kaum ib hlis
Anonim
Tic Tac Toe
Tic Tac Toe

Tinkercad Cov Haujlwm »

Hnub no peb yuav ua Tic Tac Toe game ntawm TinkerCad siv Arduino. Peb tab tom yuav siv ntau yam yooj yim thiab siv cov cai los khi lawv txhua tus ua ke. Lub hauv paus tseem ceeb ntawm cov kab ke no uas coj txhua qhov no ua ke yog cov cai. Txoj haujlwm no muaj ntau txoj hauv kev thiab tuaj yeem hloov pauv mus rau txawm li cas los xij tus neeg siv pom zoo. Qhov kev ua si no tseem muaj kev xaiv siv RGB teeb, tab sis yog tias leej twg xav tau ua ntej ntawm txoj haujlwm no lawv yuav xav tau txuas 2 arduinos rau ib leeg.

Khoom siv

  • Arduino
  • Breadboard (loj)
  • Hlau
  • Pushbutton
  • LEDs
  • Resistors (10k thiab 150)
  • Photoresistors

Kauj ruam 1: Pib

Pib
Pib

Yog li peb yuav pib qhov no nrog lub thawv ntim khoom loj thiab Arduino microcontroller.

Kauj Ruam 2: Ntxiv LEDs

Ntxiv LEDs
Ntxiv LEDs

Cov kauj ruam tom ntej yog ntxiv LEDs thiab khawm lub pob rau ntawm lub khob cij. Peb tseem tsis tau txuas lawv tab sis tsuas yog muab lawv tso rau hauv lub rooj tsav xwm kom tsis muaj cov xov hlau cuam tshuam nrog lwm lub khawm. Muaj ntau yam khoom siv yog li peb yuav tsum tso lawv tawm zoo li no yog li tsis muaj leej twg kov. Daim ntawv qhia zaub mov loj tau pom zoo rau txoj haujlwm no.

Kauj Ruam 3: Digital Pins

Cov Pins
Cov Pins

Yog li ua ntej peb ntxiv lwm yam cia ua ntej txuas cov pins digital rau LEDs. Hauv txoj haujlwm no, peb tab tom yuav siv tag nrho cov analog thiab digital pins uas Arduino muaj.

Kauj ruam 4: PushButtons

PushButtons
PushButtons

Rau cov kauj ruam no peb yuav txuas lub zog thiab hauv av rau lub khawm. Hauv cov kauj ruam no peb yuav siv 10k resistors txhawm rau txwv lub zog. 2 lub nyees khawm ntawm sab xis tsis siv los tig lub LED qhib lossis kaw, tab sis lawv tau siv los pib qhov kev ua si tshiab, thiab rau lwm yam peb yuav pom thaum peb pib qhov chaws.

Kauj Ruam 5: Digital thiab Analog Pins

Digital thiab Analog Pins
Digital thiab Analog Pins

Hauv cov kauj ruam no peb yuav txuas cov nyees khawm rau digital thiab analog pins. Cov pins analog tuaj yeem siv tau hauv qhov no vim tias lawv tuaj yeem siv tib txoj kev siv cov koob digital.

Kauj Ruam 6: Photoresistors

Photoresistors
Photoresistors

Hauv theem no, peb yuav txuas cov photoresistors mus rau LEDs. Lub ntsiab lus ntawm qhov no yog kom cov neeg sib txawv tau txais qib sib txawv ntawm qhov ci ntsa iab thiab qhov no tso cai rau cov players sib txawv ntawm lawv tus kheej. Hauv qib no koj pom yog vim li cas kev sib nrug ntawm cov qib sib nrug yog qhov tsim nyog.

Kauj Ruam 7: Txheeb cais Variables

Txhais Variables
Txhais Variables

Hauv cov kauj ruam no, peb tab tom yuav pib qhov chaws. Thawj feem ntawm qhov no yuav tau txhais cov nyees khawm sib txawv thiab LEDs, tab sis kuj tseem muaj lwm qhov sib txawv uas sib npaug rau 0. Qhov sib txawv no yuav pab peb tig LEDs rau thiab tawm nrog nias lub pob.

Kauj Ruam 8: Tshaj Tawm Cov Hloov Pauv

Tshaj tawm Cov Hloov
Tshaj tawm Cov Hloov

Hauv cov kauj ruam no, peb tab tom ua kom tiav qhov kev tshaj tawm ntawm cov kev hloov pauv no thiab teeb tsa cov nyees khawm raws li kev nkag, thiab LEDs raws li kev tso tawm.

Kauj ruam 9: Chaw thau khoom

Chaw thau khoom
Chaw thau khoom

Ib feem ntawm txoj cai no tuaj yeem pom ua "thau khoom npo". Feem ntau cov kev ua si feem ntau muaj qee qhov pib ua ntu zus thaum pib tab sis ntu no yog nyob ntawm yeem thiab tsuas yog ua tiav rau cov yeeb yam. Nov yog qhov lwm lub pob uas nyob ntawm sab xis tuaj yeem siv rau. Nws tuaj yeem tso tawm qhov pib ua ntu zus kom txog rau thaum "pib khawm" raug nias.

Kauj Ruam 10: LED On/Off

LED On/Off
LED On/Off

Cov kauj ruam no tsom mus rau cov cai tseem ceeb ntawm yuav ua li cas qhib LED qhib thiab tawm nrog cov nyees khawm. Hauv txoj cai no, peb yuav siv qhov sib txawv uas sib npaug 0 uas peb tau tsim thaum xub thawj thaum txiav txim siab peb cov kev hloov pauv. Raws li txoj cai no, LED yuav qhib thaum lub pob nyem, tab sis yuav tig rov qab thaum nws nias dua.

Kauj Ruam 11: Tawm Khawm

Tawm khawm
Tawm khawm

Cov kauj ruam no qhia tus lej khawm lossis khawm game tshiab. Qhov no yog siv thaum tus neeg uas ua ntawv yeej lossis ua tiav qhov kev ua si, thiab qhov kev ua si yuav rov pib dua thiab tuaj yeem rov pib dua. Lub pob no yog qhov pib dua khawm uas rov pib lub voj kom cov game tuaj yeem ua si ntau thiab ntau dua.

Kauj Ruam 12: Txaus Siab Ua Si

Txaus Siab Ua Si!
Txaus Siab Ua Si!

Qhov ntawd yog qhov kawg ntawm qhov kev qhia no thiab kuv vam tias koj yuav muaj kev lom zem ua si ib puag ncig nrog cov kab ke no thiab cov cai thiab hloov pauv ntau ntxiv rau hauv Circuit Court no vim tias qhov muaj peev xwm tsis muaj qhov kawg vim qhov no yog qhov qhib qhov program.

Pom zoo: