Cov txheej txheem:

8x16 LED Matrix Pong Game (2 Paddles Per Player Version): 3 Kauj Ruam
8x16 LED Matrix Pong Game (2 Paddles Per Player Version): 3 Kauj Ruam

Video: 8x16 LED Matrix Pong Game (2 Paddles Per Player Version): 3 Kauj Ruam

Video: 8x16 LED Matrix Pong Game (2 Paddles Per Player Version): 3 Kauj Ruam
Video: 8x16 LED Matrix Pong Game (2 paddles per player) 2024, Hlis ntuj nqeg
Anonim
Image
Image
8x16 LED Matrix Pong Game (2 Paddles Per Player Version)
8x16 LED Matrix Pong Game (2 Paddles Per Player Version)

Kuv tau txais kev tshoov siab los ntawm ntau qhov kev hloov pauv ntawm Pong kev ua si qub siv los ntawm Arduino siv 8x8 LED matrix. Hauv cov lus qhia no, kuv yuav qhia koj yuav tsim li cas kuv nyiam Pong version uas muaj ob lub duav - tus ntaus thiab lub hom phiaj - rau ib tus neeg ua si. Txij li 8x8 LED matrix muaj qhov txwv tsawg heev (lossis cov ntawv), Kuv yuav siv 8x16 LED matrix hloov ntawm txoj haujlwm no. Txhawm rau txuas yooj yim, Kuv yuav siv ob qhov 8x8 LED matrix nrog built-in MAX7219 thiab ib lub zog loj ib leeg rau ib tus neeg ua si rau kev tswj duav.

Kauj ruam 1: Cov ntaub ntawv

  • Arduino Uno lossis sib npaug
  • (2) 8x8 LED matrix nrog MAX7219
  • (2) 10K potentiometer
  • jumper cov xov hlau
  • Lub roj teeb 9v & roj teeb 9v
  • lub thawv ntawv (Kuv qhov kev daws teeb meem ib txwm yog lub thawv ntawv thawv)

Cov cuab yeej: phom phom, riam

Kauj ruam 2: Khoos phis tawj khoos phis tawj

Khoos phis tawj sib dhos
Khoos phis tawj sib dhos
Khoos phis tawj sib dhos
Khoos phis tawj sib dhos

Xa mus rau kuv cov vis dis aus thiab kab duab kab rau kev sib dhos kho vajtse.

Kauj ruam 3: Code

Code
Code
Code
Code

Txuas nrog yog tus lej Arduino Kuv siv rau qhov kev ua si qhia hauv video.

Txog qhov haujlwm no, Kuv siv lub tsev qiv ntawv max7219 yooj yim hu ua LedControl. Yog tias koj tsis muaj lub tsev qiv ntawv no tau teeb tsa ntawm koj li Arduino IDE, thov ua raws cov lus qhia ntawm lawv lub vev xaib rau rub tawm thiab teeb tsa.

Txhawm rau taug qab pob txav, Kuv siv 5 qhov sib txawv. Thaum nws zoo dua los khaws txhua qhov ntawd rau hauv qhov xwm txheej hauv qhov kuv xav tau ntau lub pob rau kev ua si tawg, txoj haujlwm no tau tsim los rau cov tub ntxhais kawm theem nrab yog li kuv ua qhov yooj yim no.

Txog kev tso cov neeg ua si, Kuv tab tom nyeem cov peev xwm tshwj xeeb uas rov qab qhov tseem ceeb ntawm 0 thiab 1023 thiab qhia lawv rau qhov tseem ceeb ntawm 0 thiab 7 rau Y ua haujlwm.

Siv lub platform no, koj tseem tuaj yeem sau lwm yam kev ua si xws li nab, tsav tsheb, tua, thiab tawm mus. Kuv tau sau ob tus neeg sib tw ua si sib tw nrog ob lub pob txav mus ib txhis tab sis vim qhov kev daws teeb meem qis thiab cov pob ib txwm txav hauv 45 degree, nws tsis ua haujlwm zoo li kuv xav tias nws yog. (Yog tias koj google, koj tuaj yeem pom ib tus neeg ua si sib ntaus sib tua.)

Pom zoo: