Cov txheej txheem:

ESP32 VGA Snake: 5 Kauj Ruam
ESP32 VGA Snake: 5 Kauj Ruam

Video: ESP32 VGA Snake: 5 Kauj Ruam

Video: ESP32 VGA Snake: 5 Kauj Ruam
Video: ESP32 VGA PC running BASIC 2024, Hlis ntuj nqeg
Anonim
Image
Image
Kauj Ruam 3: Txuas VGA Port
Kauj Ruam 3: Txuas VGA Port

Hauv cov lus qhia no kuv yuav qhia yuav ua li cas rov tsim dua cov game arcade classic - Snake - nrog ESP32, nrog cov zis rau VGA saib.

Kev daws teeb meem yog 640x350 pixels, hauv 8 xim.

Kuv tau ua yav dhau los nrog Arduino Uno (saib ntawm no), tab sis qhov kev daws teeb meem tsuas yog 120 x 60 pixels, 4 xim.

Txoj haujlwm no ua tau los ntawm txaus ESP32 VGA lub tsev qiv ntawv sau los ntawm Fabrizio Di Vittorio. Saib ntawm no kom paub meej ntxiv.

Kauj Ruam 1: Kauj Ruam 1: ESP32 Boards, Arduino IDE Installation thiab VGA Library Configuration

Cov kauj ruam no zoo ib yam rau Kauj Ruam 1 ntawm kuv txoj haujlwm yav dhau los ua tiav nrog ESP32, yog li tsuas yog ua raws qhov txuas no, pib nyeem ntawv los ntawm Kauj Ruam 1 txog rau Qib 3 tsis suav nrog.

Koj muaj ntau dua los nruab FabGL VGA lub tsev qiv ntawv, tab sis rau Snake koj xav tau qhov hloov tshiab kawg: tsuas yog thaum nws yuav hloov pauv yav tom ntej, Kuv tso rau hauv qab ntawm cov kauj ruam no ua haujlwm ua haujlwm hauv cov ntawv src.new.rar. Koj tuaj yeem rub tawm, uncompress thiab hloov lub npe ua "src" hauv koj li

"… / arduino-1.8.9 / libraries" nplaub tshev.

Kauj Ruam 2: Kauj Ruam 2: Tshaj Tawm "Snake" mus rau ESP32

Rub tawm Snake.ino hauv qab ntawm cov kauj ruam no. Qhib nws nrog Arduino IDE thiab xa nws mus rau koj li raw ESP32. Yog tias koj tsis muaj lus yuam kev, tus lej yuav tsum tau ua haujlwm lawm.

Kauj Ruam 3: Kauj Ruam 3: Txuas VGA Port

Koj xav tau cov hauv qab no:

  • DSUB15 Connector, piv txwv li yog VGA poj niam txuas lossis VGA cable kom raug txiav.
  • peb 270 Ohm resistors.

Txuas ESP32 GPIO tus pin 2, 15 thiab 21 rau VGA Liab, Ntsuab thiab Xiav feem, dhau ntawm 270 Ohm resistors.

Txuas VGA Hsync thiab Vsync rau ESP32 GPIO pins 17 thiab 4 feem.

Txuas DSUB15 tus pin 5, 6, 7, 8 thiab 10 rau ESP32 GND.

Txog VGA DSUB15 tus lej txuas tus lej txhais, saib daim duab hauv qib no. NB, qhov no yog sab laug ntawm tus poj niam txuas.

Kauj Ruam 4: Kauj Ruam 4: Txuas Plaub Khawm

Kauj Ruam 4: Txuas Plaub Plaub Khawm
Kauj Ruam 4: Txuas Plaub Plaub Khawm
Kauj Ruam 4: Txuas Plaub Plaub Khawm
Kauj Ruam 4: Txuas Plaub Plaub Khawm
Kauj Ruam 4: Txuas Plaub Plaub Khawm
Kauj Ruam 4: Txuas Plaub Plaub Khawm

Cov txheej txheem hauv theem no qhia yuav ua li cas txuas ib lub pob (Ib txwm Qhib) los ntawm +5V rau ESP32 muab tus pin. Nco ntsoov tias koj kuj yuav tsum txuas ESP muab tus pin rau GND hla 1 rau 2 kOhm resistor. Txoj hauv kev no thaum lub pob raug tso tawm (qhib) ESP tus pin nyob ntawm pes tsawg Volts.

Tshwj xeeb tshaj yog, koj yuav tsum txuas plaub lub khawm nrog cov lus txib hauv qab no:

  • Pin 12 rau Txoj Cai khawm
  • Pin 25 to Up button
  • Pin 14 rau Sab laug
  • Pin 35 rau khawm Down

Kauj Ruam 5: Kauj Ruam 5: Xaus thiab Pom Zoo

Yog tias txhua yam ua haujlwm tau zoo, tsuas yog txuas VGA saib thiab koj yuav tsum muaj peev xwm txaus siab rau Snake.

Kuv xav qhia kuv lub tso tsheb hlau luam rau Fabrizio Di Vittorio rau nws txaus ESP32 VGA tsev qiv ntawv. Yog xav paub ntau ntxiv, piv txwv, thiab… Space Invaders, mus saib nws lub xaib.

Yog tias koj nyiam txoj haujlwm no, thov sau ntawv tawm tswv yim lossis faib daim duab ntawm lub cuab yeej uas koj tsim … thiab, tag nrho, pov npav rau nws hauv GAMES Contest!

Pom zoo: