Cov txheej txheem:

Phau Ntawv Qhia Teeb Duab: 9 Kauj Ruam
Phau Ntawv Qhia Teeb Duab: 9 Kauj Ruam

Video: Phau Ntawv Qhia Teeb Duab: 9 Kauj Ruam

Video: Phau Ntawv Qhia Teeb Duab: 9 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Phau Ntawv Qhia Kev Nyuaj Siab
Phau Ntawv Qhia Kev Nyuaj Siab

Txoj haujlwm no yog txhawm rau ua ib hom kev qhia pas nrig rau cov neeg dig muag kom pom lawv txoj hauv kev. Txawm li cas los xij, Kuv tau xaiv hloov nws mus ua game uas txhua tus tuaj yeem ua si. Kuv tau ua tus pas nrig qhia uas yog lub teeb pom kev zoo, thiab nws yuav ua suab nrov thaum nws hnov qhov ci ntsa iab. Tus neeg uas ua ntawv yuav tsum hnav lub qhov ncauj qhov muag thiab siv tus pas nrig los nrhiav cov khoom muaj nqis uas muaj teeb ci rau nws. Yog li ntawd, thaum tus pas nrig qhia ua suab nrov, tus neeg ua si paub cov khoom muaj nqis nyob ntawm nws xub ntiag.

Khoom siv

Cov khoom siv xav tau rau txoj haujlwm no:

Cov Cuab Yeej:

- Hniav

- Txiab

- Tus kav

- Cwj mem

- Cov duab los qhia

- Kub yaj kua nplaum phom

- 1 lub txhab nyiaj fais fab

Cov ntaub ntawv Arduino:

- x1 daim ntawv qhia zaub mov

- x1 Arduino UNO lub rooj tsavxwm

- Jumper xov hlau

-1 x Kev tiv thaiv kab mob

- x1 220-ohm tsis kam

- x1 lub suab

Kauj ruam 1: Pasting Code

Txhim Kho Txoj Cai
Txhim Kho Txoj Cai

Ua ntawv thov cov cai hauv qab no thiab muab tshuaj txhuam nws tso rau ntawm Arduino, xa cov cai mus rau xaim.

void teeb tsa ()

{

Serial.begin (9600);

}

void lub voj ()

{

Serial.print (analogRead (A0));

Serial.print ("");

Serial.println ();

ncua (20.0);

yog (((analogRead (A0))>> 1000.0)))

{

suab (3, 1000.0, 100.0);

ncua (100);

suab (3, 800.0, 100.0);

ncua (100);

suab nrov (3, 600.0, 100.0);

ncua (100);

}

}

Kauj Ruam 2: Teeb tsa Breadboard

Hauv cov kauj ruam no, koj yuav teeb tsa koj lub Arduino breadboard thiab tsom mus rau hauv Circuit Court. Koj yuav xav tau tag nrho "Cov ntaub ntawv Arduino" hais los saum no.

Kauj Ruam 3: Teeb Tus Photoresistor

Teeb tsa tus Photoresistor
Teeb tsa tus Photoresistor

Hauv theem no, koj yuav tsom mus rau teeb tsa lub photoresistor li cas.

Ua ntej tshaj, siv cov hlua txuas txuas 5V rau tus nqi zoo thiab txuas GND rau tus nqi tsis zoo. Qhov thib ob, siv txoj hlua dhia txuas txuas tus nqi zoo rau lub qhov khawb ntawm lub khob cij. Tom qab ntawd tso tus photoresistor ntawm tib txoj kab ntsug raws li cov hlua dhia koj tsuas yog tso nws. Tom ntej no, tso lwm lub jumper hlau txuas lub photoresistor rau A0 tus pin. Thib peb, muab 220-ohm resistor rau tib txoj kab ntsug raws li cov hlua hlau txuas uas txuas rau A0. Thaum kawg, tso lub jumper xaim txuas tus tiv thaiv rau qhov tsis zoo. (saib daim duab saum toj no)

Kauj Ruam 4: Teeb tsa Lub Buzzer

Teeb tsa lub Buzzer
Teeb tsa lub Buzzer

Cov kauj ruam no koj yuav teeb tsa lub buzzer.

Ntawm peb theem yooj yim kom ua tiav lub Circuit Court ntawm lub buzzer. Ua ntej tshaj, siv lub jumper xaim txhawm rau txuas qhov tsis zoo rau lub qhov khoob ntawm lub khob cij. Qhov thib ob, tso lub buzzer rau ntawm kab ntsug raws li lub xaim xaim. Kawg, siv lwm lub jumper xaim txuas mus rau lwm sab ntawm lub buzzer rau D3-pin.

Txij ntawm no mus, koj tau ua tiav qhov Circuit Court xav tau rau txoj haujlwm no.

Kauj Ruam 5: Npaj rau Cov Khoom Siv Ua Sab Nraud

Koj yuav tau npaj txhua qhov "cuab yeej" uas tau hais los saum no kom ua rau sab nrauv.

Nqa cov duab los qhia thiab txiav nws mus rau qhov loj me hauv qab no:

- x2 19.5 X 14.5 cm

- x2 14.5 X 6 cm

X2 18 X 6 cm

X4 67 X 3

- x1 13 X 14 (yeem)

Kauj Ruam 6: Txhim Kho Qhov Tseem Ceeb ntawm Th Device

Txhim Kho Qhov Tseem Ceeb ntawm Th Device
Txhim Kho Qhov Tseem Ceeb ntawm Th Device
Txhim Kho Qhov Tseem Ceeb ntawm Th Device
Txhim Kho Qhov Tseem Ceeb ntawm Th Device

lo () thiab () duab los qhia ua ke los ua ib lub thawv. Nco ntsoov nkhaus lub qhov me me ntawm sab laug daim ntawv txhawm rau txhawm rau txuas Arduino UNO lub rooj tsavxwm rau lub zog siv xaim. Tsis tas li, ua ntej koj lo nws rau hauv ib lub thawv, muab tag nrho koj lub voj voog rau hauv lub thawv.

Kauj Ruam 7: Txhim Kho Tus Kov

Txhim Kho Tus Kov
Txhim Kho Tus Kov
Txhim Kho Tus Kov
Txhim Kho Tus Kov

Hauv cov kauj ruam no, koj yuav tau lo plaub () duab los qhia ua ke thiab tsim ib lub duab plaub. Tom qab ntawd, nco ntsoov zais cov hlau sab hauv tus kov thiab nthuav tawm lub ntsaws rau lub txhab nyiaj tom qab.

Kauj Ruam 8: Ua Ntawv Thov Power Bank

Ua Ntawv Thov Power Bank
Ua Ntawv Thov Power Bank

Cov kauj ruam no koj yuav tau npaj lub txhab nyiaj fais fab thiab txuas nws mus rau xaim. Tom qab ntawd, lo nws tom qab ntawm tus tes thiab npog nrog daim duab los qhia. Tom qab cov kauj ruam no, koj ua tiav nrog lub cuab yeej.

Kauj ruam 9: Txaus siab rau Game !!!

Image
Image

Kauj ruam kawg koj yuav tsum ua yog npaj cov khoom muaj nqis. ib qho ntawm cov khoom muaj nqis yuav tsum ci. Kaw lub teeb, hnav lub qhov muag qhov muag, tuav rau phau ntawv qhia saib lub ntsej muag, thiab nrhiav cov khoom muaj nqis !!!

Pom zoo: