Cov txheej txheem:

Tsim Arduino Simon Game hauv 2 feeb!: 3 Kauj Ruam
Tsim Arduino Simon Game hauv 2 feeb!: 3 Kauj Ruam

Video: Tsim Arduino Simon Game hauv 2 feeb!: 3 Kauj Ruam

Video: Tsim Arduino Simon Game hauv 2 feeb!: 3 Kauj Ruam
Video: Getting Started with LILYGO - TTGO SIM 7000G Module • Introduction & Testing All functions • IOT 2024, Hlis ntuj nqeg
Anonim

Tsis muaj Jumpers! Tsis muaj xov hlau! Tsis muaj Soldering! Tsis muaj Breadboard!

Xav sab nraum lub thawv.

Yog li koj xav qhia tawm koj lub micro-maub los hauv kev hais kwv txhiaj nrog qee qhov ntxiv ntawm cov qauv siv sab hauv nrawm heev, ua ntej cov phooj ywg lossis txheeb ze tab tom taug kev …

Muab tso ua ke Qhov Ceev & Yooj Yim ntawm Simon "rov ua dua kuv" game hauv feeb xwb. Albeit, monochromatic (nrog txhua tus LEDs liab). Txhua yam uas yuav tsum tau muaj yog nyob ntawm tes: Ib qho Arduino microcontroller (nyiam dua Nano), ib qho qauv nrog teeb ntawm LEDs, 4 khawm module, thiab lub suab nrov, nrog rau roj hmab-qhab.

Kauj Ruam 1: Qhov Chaw thiab Los Ua Ke

Qhov Chaw thiab Los Ua Ke
Qhov Chaw thiab Los Ua Ke
Qhov Chaw thiab Los Ua Ke
Qhov Chaw thiab Los Ua Ke

LED & Key/khawm modules tuaj yeem pom ntawm no: www.ebay.com/itm/181563923440 (<$ 4) Buzzers muaj nyob ntawm no: https://www.ebay.com/itm/281280117872 (<$ 2)

[ua haujlwm txuas ntxiv] BTW: Nov yog qhov yooj yim - cov cuab yeej siv https://itty.bitty.site [ua haujlwm txuas ntxiv]

Qhov no yuav tsum tau muab tshem tawm.

app dawb

Cov Lus Qhia Ntxiv

Nano 3.0 https://www.ebay.com/itm/131517734419 (<$ 3)

Kuv pom zoo kom siv cov roj hmab me me, yog li koj tsis tas yuav qhwv nws ib puag ncig ua ke kom nws nruj.

Lwm yam Arduinos tuaj yeem siv tau, tab sis yuav xav tau (lossis tso cai) qhov chaw sib txawv ntawm cov txheej txheem ib puag ncig; thiab raws li kev hloov pauv tus lej hauv cov cai siv. Nano 3.0 yog qhov tshwj xeeb tshaj yog qhov nws ua rau kev sib sau me me, tuav tau yooj yim thiab ua haujlwm nrog ib txhais tes.

Kev sib dhos ua tiav los ntawm kev yooj yim ntsaws rau hauv cov qauv thiab ruaj ntseg nrog cov roj hmab-qhab. Qhov "nquag" piezo buzzer yuav tsuas ua haujlwm yog tias lub polarity tau sib txuas kom raug. Thov nco ntsoov tias nws (+) tau ntxig rau hauv D8, thiab (-) rau D11.

Qhov tseem ceeb module pins K4-K3-K2-K1-GND mus ncaj qha rau A1-A5. Saib duab saum toj no.

LED module pins GND-D1-D2-D3-D4-D5-D6 mus ncaj qha rau D7-D6-D5-D4-D3-D2-GND feem.

Kauj Ruam 2: Nws Ua Haujlwm Li Cas

LED thiab Cov Qauv Tseem Ceeb yog npaj kom nquag muaj ib tus pin txuas rau hauv av. Txhawm rau kom haum qhov txuas ncaj qha rau Nano qhov no tsis tshwm sim. Yog li hloov tus pin txuas nrog 'GND's ntawm cov qauv no tau ua haujlwm raws li cov txiaj ntsig thiab teeb tsa' LOW '. MCU (MicroControllerUnit) yuav tsav nws cov zis mus txog 30 ma. Uas yog txaus rau lub txhab nyiaj ntawm plaub (4) LEDs. Thaum nws nyob deb dua yog xav tau rau cov nyees khawm tsis muaj kev phom sij raws li qhov tam sim no tau txwv (thiab lawv tsuas yog kos tam sim no thaum nias). LED module muaj inline resistors ntxiv txwv qhov tam sim no uas dhau los ntawm txhua LED.

Rub tawm

Kuv hloov kho thiab hloov kho ob qhov sib txawv ntawm 'Simon' ua raws kuv teeb thiab suab game kom ua haujlwm nrog txoj haujlwm no. Cov qhab nia rau cov ntawv qub yog nyob hauv cov npe teev npe.

Ib daim duab kos (FastEasy_SimonSings) tsuas yog siv cov ntawv suav nrog ('pitches.h' kom nyob hauv daim nplaub tshev nrog nws). Thaum lwm tus (FastEasy_SimonSays) siv lub tsev qiv ntawv 'Tone'. Yog li koj yuav xav tau ib lossis ob qho ntawm cov ntawd, nyob ntawm seb cov duab kos uas koj xaiv siv.

Cov tsev qiv ntawv saum toj no yuav tsum yog ib feem ntawm Arduino IDE los ntawm lub neej ntawd. Yog tias tsis yog thiab koj xav tau kev pab nrog qhov no ntawm no yog Yuav Ua Li Cas Nruab Lub Tsev Qiv Ntawv.

Kauj Ruam 3: Ua Si Nrog Lub Rooj Sib Tham

Ua Si Nrog Lub Rooj Sib Tham
Ua Si Nrog Lub Rooj Sib Tham

Kev ua si yog ncaj ncaj rau pem hauv ntej. Cov ntaub ntawv qhov chaws muaj qee cov ntaub ntawv hauv lawv. Txhua yam koj yuav xav paub tiag tiag yog tias 'Simon Says' version pib pib nrog ib qho nyem. thiab 'Simon Sings' version pib nrog tus qauv ntawm 4, tab sis nws tos tos qhov tseem ceeb nias ua ntej pib txhua puag ncig.

Koj yuav zoo li pom cov LED thiab Cov qauv tseem ceeb ua ke rau ua lwm txoj haujlwm ceev pov thawj ntawm cov ntsiab lus. Txoj haujlwm no thiab cov lej cuam tshuam yuav ua haujlwm nrog tus hais lus. Nws yuav suab zoo dua, tab sis koj yuav tsis tuaj yeem ua nws yam tsawg kawg qee tus dhia.

Daim ntawv ceeb toom tias raws li cov qauv kab kos no tau sau tseg, Nano 3.0 lossis Uno yuav ua haujlwm (Plug-&-Play) ncaj qha, lwm tus yuav xav siv cov koob sib txawv ntawm cov koob vim lawv kev teeb tsa lub cev; thiab tejzaum qee qhov kev hloov pauv.

Pom zoo: