Cov txheej txheem:

LED Lub Hau Zaub Nrog Pong: 12 Cov Kauj Ruam (nrog Duab)
LED Lub Hau Zaub Nrog Pong: 12 Cov Kauj Ruam (nrog Duab)

Video: LED Lub Hau Zaub Nrog Pong: 12 Cov Kauj Ruam (nrog Duab)

Video: LED Lub Hau Zaub Nrog Pong: 12 Cov Kauj Ruam (nrog Duab)
Video: Niam tais Npab Ntxhais tuag ua Dab 1/23/2020 2024, Hlis ntuj nqeg
Anonim
LED Lub Hau Zaub Nrog Pong
LED Lub Hau Zaub Nrog Pong
LED Lub Hau Zaub Nrog Pong
LED Lub Hau Zaub Nrog Pong
LED Lub Hau Zaub Nrog Pong
LED Lub Hau Zaub Nrog Pong
LED Lub Hau Zaub Nrog Pong
LED Lub Hau Zaub Nrog Pong

Ib pliag dhau los, raws li kuv thawj qhov project microcontroller, Kuv tau ua Pong game ntawm 5x7 LED zaub, tab sis tom qab ntawd tsis muaj dab tsi los ntawm nws. Tsis ntev los no kuv tau muab lub kaus mom nyuaj ua ib feem ntawm kev hnav (rau kev sib tw engineering) thiab hais kom hloov kho nws, thiab nco txog pong. lub kaus mom. Nws tseem ua si pong!

Kauj ruam 1: Cov ntaub ntawv

Khoom siv
Khoom siv

Qhov: -2 10k potentiometers- 3 4.7 kOhm resistors-4 SPST toggle keyboards-1 5x7 bicolour LED zaub-1 8 tus pin dipswitch-1 Hardhat-1 atmega168 microcontroller (lossis arduino) -1 28 Pin 'yuag' socket-1 breadboard- 1 3.7V lithium polymer battery-Wire-Solder-Hot GlueTools: -Soldering Iron-Hot Glue Gun-Wire Stripper-Hobby Rife-Plexiglas Txiav Riam- Microcontroller Programmer (yeem)

Kauj ruam 2: Solder Display

Solder Zaub
Solder Zaub
Solder Zaub
Solder Zaub
Solder Zaub
Solder Zaub
Solder Zaub
Solder Zaub

Rau thawj kauj ruam, koj yuav tsum tau xaim cov xov hlau rau cov zaub. Koj kuj tseem yuav xav tau ib qho hloov pauv los ntawm kev hloov pauv ntawm ob xim 'cathodes rau txhua kab. Txhawm rau kom pom meej dua Kuv tau txuas nrog cov txheej txheem ntawm cov duab hauv cov duab (nyem

Rau cov kauj ruam tom ntej kuv siv hloov 8 rau 'hom kev mus ncig'. Qhov no yog li lub kaus mom tsis ua yuam kev tig rau hauv lub hnab thiab ntws.

Kauj Ruam 3: Siv Lub Hwj Huam Sib Txuas

Solder Cov Kev Sib Txuas Fais Fab
Solder Cov Kev Sib Txuas Fais Fab
Solder Cov Kev Sib Txuas Fais Fab
Solder Cov Kev Sib Txuas Fais Fab

Rau cov kauj ruam no koj yuav tsum tau muab lub microcontroller ntsaws rau lub khob cij. Tom qab ntawd muab tag nrho cov hluav taws xob txuas rau lub microcontroller lub qhov (socket) pins. Yog tias koj tsis paub meej tias tus pin twg yuav siv tau, muaj cov ntaub ntawv zoo ntawm no.

Kauj Ruam 4: Txuas cov LEDs rau Lub Rooj Tswjhwm Saib

Txuas cov LEDs rau Pawg Thawj Coj
Txuas cov LEDs rau Pawg Thawj Coj
Txuas cov LEDs rau Pawg Thawj Coj
Txuas cov LEDs rau Pawg Thawj Coj
Txuas cov LEDs rau Pawg Thawj Coj
Txuas cov LEDs rau Pawg Thawj Coj
Txuas cov LEDs rau Pawg Thawj Coj
Txuas cov LEDs rau Pawg Thawj Coj

Tam sim no koj yuav tsum tau txuas cov xov hlau tawm los ntawm LED zaub rau lub khob cij. Txhawm rau pab nrog qhov no pom cov kab ntawv txuas, lossis koj tuaj yeem saib hauv cov cai hauv kab lus qhia kom pom cov pins tso tawm ntawm arduino.

Kauj Ruam 5: Cov Hloov Hloov

Solder Hloov
Solder Hloov
Solder Hloov
Solder Hloov
Solder Hloov
Solder Hloov
Solder Hloov
Solder Hloov

Tom ntej solder cov hloov mus rau lub khob cij. Kuv tau rov txuas dua cov duab hauv cov duab ntawm cov kauj ruam no.

Rau txhua qhov hloov pauv, nws yog ib qho kev sib txuas ntawm qhov hloov pauv txuas nrog tus pin microcontroller sib xws thiab lwm qhov rau qhov zoo. Kuj tseem muaj ib tus tiv thaiv los ntawm tus lej nkag mus rau hauv av rau txhua qhov hloov pauv.

Kauj Ruam 6: Solder Potentiometers

Solder lub Potentiometers
Solder lub Potentiometers
Solder lub Potentiometers
Solder lub Potentiometers

Txhawm rau muab cov tshuaj tua hluav taws xob tso rau hauv, ua ntej muab lub zog zoo rau ib qho ntawm cov coj sab nraud (txhua lub lauj kaub muaj 3 tus coj, ib qho rau txhua qhov kawg ntawm tus tiv thaiv thiab ib qho rau qhov nruab nrab hloov pauv). Solder qhov tsis zoo rau lwm cov hlau lead sab nraud thiab xaim mus ntawm qhov sib piv sib xws hauv microcontroller, thiab cov hlau lead nruab nrab. Ua qhov no rau txhua lub lauj kaub.

Dab tsi ntawm sab koj cuam tshuam qhov ua tau zoo thiab tsis zoo ntawm cov teeb meem, nws cuam tshuam li cas koj tig lub lauj kaub kom txav lub duav nce lossis nqis. Txoj hauv kev zoo tshaj plaws los txiav txim seb sab twg yuav tsum sib dhos nws yog txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm Los yog cia li twv thiab hloov nws tom qab. Qhov no kuj yog qhov chaw zoo los hais lus tus neeg hais lus, txuas ib sab rau tus pin 15 ntawm lub microcontroller thiab lwm qhov rau hauv av.

Kauj Ruam 7: Program Microcontroller

Program lub Microcontroller
Program lub Microcontroller

Qhov no tuaj yeem yog txoj haujlwm txaus ntshai tshaj plaws yog tias koj tshiab rau microcontrollers. Kev teeb tsa kuv siv rau program microcontrollers siv AVRisp mkII txhawm rau thauj lub bootloader rau Arduino, uas tuaj yeem ua haujlwm dhau USB. Load qhov program txuas rau cov kauj ruam no (lossis hauv intro) mus rau microcontroller (.hex file hauv applet nplaub tshev tuaj yeem thauj mus rau lub microcontroller qhov chaw ntawm lub bootloader). Thaum hlawv lub bootloader, teeb lub nti siv 8MHz siv lead ua sab hauv, tshwj tsis yog tias koj xav siv cov siv lead ua sab nraud (qhov nrawm ntxiv tsis xav tau tiag tiag). Yog tias koj rov sau cov cai kom paub tseeb tias nws yog lub moos nrawm raug rau qhov koj yuav siv. Thaum twg nws tau teeb tsa, muab lub nti tso rau hauv lub qhov (socket) ntawm lub khob cij.

Kauj Ruam 8: Xeem thiab Debugging

Kev Xeem thiab Debugging
Kev Xeem thiab Debugging
Kev Xeem thiab Debugging
Kev Xeem thiab Debugging
Kev Xeem thiab Debugging
Kev Xeem thiab Debugging

Tam sim no yog lub sijhawm los txuas lub roj teeb thiab vam tias nws ua haujlwm.

Yog tias nws tsis ua haujlwm, Kuv yuav sim muab qee cov lus qhia kev debugging: yog tias ib txoj kab tsis muaj los ntawm cov zaub, nws yog kev sib txuas xoob lossis xaim xaim luv. tsis muaj dab tsi tshwm sim, xub tshuaj xyuas lub zog thiab cov hloov pauv. Yog tias nws tau txais qhov hluav taws xob tsim nyog thiab tseem tsis ua haujlwm (thiab lub nti tau ntsaws rau hauv txoj hauv kev kom raug), ntsuas txhua yam ntawm ib feem ntawm ib qho. Yog tias nws muaj zog, tab sis lub vijtsam tsis tso tawm kom raug, xyuas kom tseeb tias koj muaj lub ntsej muag zoo, 5 kab cathode thiab 7 anode kab (daim ntawv lo ntawm kab thiab kab tuaj yeem sib txawv ntawm cov ntaub ntawv rau cov ntaub ntawv). Yog tias nws tseem tsis ua haujlwm, tawm lus tawm thiab kuv yuav sim pab.

Kauj ruam 9: Kev ua haujlwm

Kev ua haujlwm
Kev ua haujlwm

Thaum nws tau qhib, tig ib qho kom hloov ntawm Pong thiab hom zaub.

Hauv hom zaub nws yuav qhia UOIT (kuv lub tsev kawm ntawv) thiab yog tias koj tig hloov 3 nws yuav qhia ERTW (cov ntsiab lus ntxiv ntawm koj xam qhov no tawm). Hauv Pong hom, tig lub hwj chim kom txav cov paddles. Tig tig 2 kom hloov pauv los ntawm 1 tus neeg ua si rau 2 tus neeg ua si thiab yog tias koj pom nws yooj yim heev, tig tig 3 kom nrawm dua.

Kauj Ruam 10: Npaj Lub Hau Lub Qhov Ncauj

Npaj Lub Hau Cov Zaub Qhov
Npaj Lub Hau Cov Zaub Qhov
Npaj Lub Hau Cov Zaub Qhov
Npaj Lub Hau Cov Zaub Qhov
Npaj Lub Hau Cov Zaub Qhov
Npaj Lub Hau Cov Zaub Qhov

Nov yog thawj qib hauv kev txhim kho cov khoom siv hluav taws xob hauv koj lub kaus mom.

Pib los ntawm kev taug tus qauv ntawm cov zaub thiab txiav nws. Kab xev txiav tawm rau lub kaus mom qhov twg koj xav kom cov zaub mus, tom qab ntawd taug nws nrog rab riam nyiam. Ceev faj sib txawv ntawm ntu no, nws yooj yim rau plam thaum txiav cov tawv nkhaus. Tam sim no nrog tus qauv ntawm lub kaus mom, nqa rab riam yas txiav thiab taug raws kab kom txog thaum koj poke dhau. Tam sim no ua kom tiav lub qhov los ntawm kev txiav tawm cov yas txuas ntxiv nrog rab riam hobby.

Kauj Ruam 11: Laum Qhov Hloov Qhov

Laum qhov Hloov Qhov
Laum qhov Hloov Qhov
Laum qhov Hloov Qhov
Laum qhov Hloov Qhov

Kuv tso kuv lub qhov hloov mus rau hauv nruab nrab zoo li luv hlau Mohawk, tab sis koj tuaj yeem tso lawv nyob qhov twg koj nyiam.

Pib los ntawm kev ua Xs me me, ib qho rau txhua qhov hloov pauv thiab khoom siv ntxiv. Xev cov no rau lub kaus mom hlau nrog nruab nrab ntawm X qhov koj xav tau lub qhov. Tam sim no xaiv qhov loj me uas tsim nyog thiab laum txhua qhov.

Kauj Ruam 12: Ua kom tiav lub kaus mom

Tiav lub kaus mom
Tiav lub kaus mom
Tiav lub kaus mom
Tiav lub kaus mom
Tiav lub kaus mom
Tiav lub kaus mom

Kauj ruam kawg yog txhawm rau txhim kho txhua ntu hauv qhov sib xws, thiab siv cov kua nplaum kub raws li qhov tsim nyog los tuav cov khoom nyob hauv qhov chaw. Kuv tau sau cov ntawv hauv cov duab kom pom ntau ntxiv.

Txhua yam uas tau ua yog qhia nws tawm! Txij li thaum koj tau nyeem qhov no deb, koj yuav tsum yog yam tsawg kawg txaus siab, yog li thov ntsuas nws!

Pom zoo: