Cov txheej txheem:

8-ntsis Arduino Gaming: 4 Kauj Ruam
8-ntsis Arduino Gaming: 4 Kauj Ruam

Video: 8-ntsis Arduino Gaming: 4 Kauj Ruam

Video: 8-ntsis Arduino Gaming: 4 Kauj Ruam
Video: qhia nqi Adobe Premiere Pro CC 2017_siv txiav Video tso Youtube 2018 2024, Kaum ib hlis
Anonim
8-ntsis Arduino Gaming
8-ntsis Arduino Gaming

Nyob zoo cov neeg!

Qhov no yuav yog kev qhia yooj yim yuav ua li cas tsim 8-ntsis kev teeb tsa kev siv game siv arduino.

Kauj Ruam 1: Cov Cheeb Tsam Xav Tau

Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau

1. Arduino (https://www.arduino.cc/)

2. Arduino IDE (https://www.arduino.cc/)

3. Breadboard lossis Vero Board (raws li koj xav tau)

4. Nokia 5110 cov duab nraaj (https://amzn.to/2N9PUd9)

5. Tactile laub khawm (https://amzn.to/2Byqwwy)

6. 12 ohm resistor

7. Ib lub suab nrov

8. Cov xov hlau txuas

Kauj ruam 2: Txuas thiab Kuaj Cov Zaub

Ua ntej pib nrog txoj haujlwm nws yog qhov zoo tshaj plaws los ua ke lub vijtsam nrog arduino thiab sim seb nws puas ua haujlwm lossis tsis yog.

Tam sim no, koj cov zaub yuav muaj 8 chaw nres nkoj: Vcc, LED, Hauv av, Rst, CE, DC, DIN thiab CLK (tsis tau xaj, txheeb xyuas koj lub chaw tsim khoom lossis lub xaib uas koj yuav nws los ntawm).

Txuas Vcc mus rau 3.3V fais fab mov ntawm arduino thiab LED thiab chaw nres nkoj hauv av yuav ob qho mus rau GND tus pin hauv arduino. Txuas tus so ntawm cov chaw nres nkoj raws li tau hais hauv txoj cai. RST-12, CE-11, DC-10, DIN-9, CLK-8.

Tam sim no khiav cov cai thiab yog tias txhua yam ua haujlwm tau zoo koj yuav tsum tuaj yeem pom txhua lub pixels ntawm lub vijtsam tig dub thiab lub teeb rov qab qhib.

## Tsis txhob muag qhov kev sib tham uas tau hais tseg hauv cov theem no tas li ##

Kauj Ruam 3: Ua Qhov Kawg Kev Sib Txuas: Screen thiab Swiches

Ua qhov kev sib txuas zaum kawg: Screen thiab Swiches
Ua qhov kev sib txuas zaum kawg: Screen thiab Swiches
Ua qhov kev sib txuas zaum kawg: Screen thiab Swiches
Ua qhov kev sib txuas zaum kawg: Screen thiab Swiches

(*Kuv paub kuv txoj haujlwm zoo li tsis nkag siab vim tias kuv tsis muaj cov khoom siv los ua PCB pawg thawj coj rau nws. Yog li kuv tau mus rau lub tsev kawm qub style*)

Qhov tseem ceeb yuav tsum muaj 4+3 = 7 khawm rau koj gamebuino. 4 khawm rau D-ncoo (nce, nqis, sab xis, sab laug) thiab seem 3 (A, B, C) rau lwm txoj haujlwm.

Rov kho dua qhov kev sib txuas hauv pawg thawj coj raws li txoj cai.

Tsis txhob hloov cov npe macro hauv cov cai.

#define SCR_CLK 13;

#define SCR_DIN 11;

#define SCR_DC A2;

#define SCR_CS A1;

#define SCR_RST A0;

#define BTN_UP_PIN 9;

#define BTN_RIGHT_PIN 7;

#define BTN_DOWN_PIN 6;

#define BTN_LEFT_PIN 8;

#define BTN_A_PIN 4;

#define BTN_B_PIN 2;

#define BTN_C_PIN A3;

#define BuzzerPin 3;

Txuas Vcc, Backlight thiab Av qhov chaw nres nkoj ntawm cov zaub raws li tau hais hauv cov kauj ruam dhau los thiab seem ntawm cov chaw nres nkoj raws li cov lus txhais tau hais hauv no.

Muab cov nyees khawm tso rau ntawm koj lub rooj tsav xwm perf. Ib lub davhlau ya nyob twg ntawm cov nyees khawm mus rau tus kheej cov chaw nres nkoj ntawm arduino raws li tau hais hauv txoj cai. Txuas lwm lub davhlau ya nyob twg ntawm txhua lub nyees khawm ua ke thiab txuas lawv rau hauv av tom qab txuas tus tiv thaiv (tus tiv thaiv tau siv los tiv thaiv luv Circuit Court txwv tsis pub yam tsis muaj tus tiv thaiv tam sim no yuav ntws ncaj qha los ntawm cov chaw nres nkoj arduino mus rau hauv av). Txuas lub buzzer ib yam nkaus.

Kauj Ruam 4: Software Tshooj thiab Koj Cov Kev Ua Si

Qhib koj tus browser thiab tshawb rau Gamebuino wiki (https://legacy.gamebuino.com/wiki/index.php?title=M…). Nkag mus rau ntu kev rub tawm ntawm lub vev xaib.

  1. Rub tawm arduino IDE (https://arduino.cc/en/main/software) thiab muab nws nruab rau hauv koj lub computer.
  2. Rub tawm lub tsev qiv ntawv gamebuino (https://github.com/Rodot/Gamebuino/archive/master…)
  3. Tsis tas li Adafruit-GFX-Library (https://github.com/adafruit/Adafruit-GFX-Library)
  4. Adafruit-PCD8544-Nokia-5110-LCD-library (https://github.com/adafruit/Adafruit-PCD8544-Noki…)

Ua ntej rub tawm arduino IDE thiab nruab nws hauv koj lub computer.

Rub tawm lwm lub tsev qiv ntawv thiab rho tawm lawv. (Kom koj lub antivirus raug kaw lossis rho tawm lawv hauv TSIS TXAUS SCAN nplaub tshev vim tias cov tshuaj tiv thaiv kab mob qee zaum cuam tshuam nrog cov ntaub ntawv hauv tsev qiv ntawv thiab koj cov cai tsis ua haujlwm txawm tias lawv tsis yog cov ntaub ntawv tsis zoo).

Luam cov ntawv rho tawm cov tsev qiv ntawv.

Tam sim no mus rau koj cov ntawv qiv tsev qiv ntawv Arduino (cov ntaub ntawv program-> arduino-> tsev qiv ntawv). Muab tshuaj txhuam cov ntawv theej ntawm no.

Txhawm rau ntsuas yog tias txhua yam tau ua haujlwm zoo lossis tsis yog Kuv tau txuas nrog Pong solo game. Sau cov ntawv ntawm koj li arduino IDE thiab tom qab ntawd rub nws mus rau lub rooj tsavxwm. Yog tias qhov no ua haujlwm txhua yam zoo.

Ua si lwm yam kev ua si:

Lub taub hau mus rau gamebuino wiki nplooj ntawv thiab mus rau ntu game. Ntawm no koj tuaj yeem pom ntau qhov game tso los ntawm hobbyist game developers. Lawv yog dawb mus download tau. Rub tawm ib qho ntawm lawv thiab rho tawm lawv hauv txoj hauv kev zoo ib yam li koj tau rho tawm cov ntawv tais ceev tseg.

Qhib cov ntawv rho tawm thiab sim tshawb rau.ino cov ntawv. Qhib qhov ntawd hauv koj li IDE thiab luam tawm lub pob thiab LCD chaw nres nkoj macro cov lus piav qhia tus lej tau hais hauv cov kauj ruam dhau los. Luam muab tshuaj txhuam txoj cai thaum pib ntawm qhov kev ua si qhov chaws. TSIS TXHOB hloov MACRO VARIABLE NAME.

Kuv tau txuas pong_solo game (yog, nws yog tag nrho cov game tsuas yog suav sau thiab ua si) thiab piv txwv ntawm qhov koj yuav tsum ua li cas hauv zombiemaster ino file (rub tawm cov zombie master game thiab hloov pauv zoo li kuv tau ua thaum pib)

Yog tias txhua yam ua haujlwm zoo mus tom ntej thiab txaus siab.:)

Yog tias koj xav ua ib feem ntawm gamebuino zej zog lub taub hau mus rau gamebuino wiki thiab koj tuaj yeem ua koj tus kheej kev ua si thiab khoom siv.

Pom zoo: