Cov txheej txheem:
- Kauj Ruam 1: Cov Npe Khoom
- Kauj ruam 2: Lub tsev qiv ntawv thiab Sketch Upload
- Kauj Ruam 3: Txuas Qhov Chaw: VGA Txuas
- Kauj Ruam 4: Txuas Qhov Chaw: Lub Hwjchim Loj thiab Khawm
- Kauj Ruam 5: Xaus thiab Txais Kev Pom Zoo
Video: ESP8266 VGA Pong: 5 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hauv Cov Lus Qhia no Kuv yuav qhia yuav ua li cas tsim kev rov tsim dua ntawm cov game classic Pong rau VGA saib, siv ESP8266 thiab ob peb yam ntxiv.
Qhov kev ua si no ua tau los ntawm EspVGAx lub tsev qiv ntawv tsis ntev los no luam tawm ntawm GitHub los ntawm Sandro Maffiodo (aka Smaffer) thiab, raws li kuv paub, qhov no yog thawj qhov kev ua si siv nws.
Lub tsev qiv ntawv siv qhov kev daws teeb meem ntawm 512 x 480 pixels, khaws cia hauv tus neeg tsim khoom sab hauv RAM, uas xav tau 30720 bytes. Kev daws teeb meem loj heev hauv kev sib piv rau Arduino TVout lossis VGAx (128 x 96 thiab 120 x 60 pixels feem). Kuv vam tias qhov kev ua si no txhawb lwm tus programmer los tsim lossis tsim dua cov kev ua si nyuaj dua.
Kauj Ruam 1: Cov Npe Khoom
Lub tsev qiv ntawv EspVGAx xav tau ESP8266 nrog txhua GPIO nthuav tawm, zoo li ESP-12E, NodeMCU-12E pawg thawj coj lossis ib lub rooj tsav xwm uas nthuav tawm GPIO5 (D1), GPIO4 (D2) thiab GPIO13 (D7)
Tshwj xeeb, kuv siv:
- ESP8266 NodeMCU-12E (txuas ntawm no)
- DSUB15 tus txuas (piv txwv li VGA tus poj niam txuas)
- ib qho 330 Ohm Resistor
- lwm tus tiv thaiv (li 1 txog 3 kOhm)
- ob 10 kOhm Potentiometers
- Push Button (n.o.)
- ob lub diode (xws li 1N4007s)
- ib daim ntawv qhia zaub mov
- xov hlau
Kuv tau txais DSUB15 txuas los ntawm VGA PC board qub. Xwb, koj tseem tuaj yeem txiav tus qub VGA cable thiab txuas cov xov hlau ncaj qha mus rau lub khob cij.
Kauj ruam 2: Lub tsev qiv ntawv thiab Sketch Upload
Muaj ntau txoj hauv kev rau txoj haujlwm thiab ESP8266; Kuv siv Arduino IDE los sau Pong thiab xa cov cai.
Thov nco ntsoov tias EspVGAx tsev qiv ntawv ua haujlwm rau Arduino IDE 1.8.1. Yog tias koj muaj lwm cov qauv, qhov zoo tshaj yog rub tawm cov ntawv.zip thiab uncompress nws hauv cov ntawv tshwj xeeb. Qhov Windows version nyob ntawm no. Versions rau lwm OS nyob ntawm no.
Tom qab ntawd, koj yuav tsum rub lub EspVGAx lub tsev qiv ntawv los ntawm GithHub nplooj ntawv no (txuas ncaj qha rau zip version ntawm no), thiab uncompress nws hauv cov ntawv tais ceev tseg hauv Arduino software.
NB Muaj kab me ntsis hauv cov ntawv espvgax_draw.h. Txhawm rau kho nws, tsuas yog hloov kab 17:
thaum (x0%32) {nrog thaum (x0%32 && sw> 32) {
Thaum kawg koj tuaj yeem rub tawm ESP8266_Pong.rar thaum kawg ntawm cov kauj ruam no.
Thaum unzipped, txhawm rau upload nws ntawm koj ESP8266, koj yuav tsum teeb tsa Arduino IDE.
Yog tias koj tsis tau ua tiav, koj tuaj yeem pom txhua qhov kev qhia xav tau ntawm Cov Lus Qhia no, tshwj xeeb hauv Kauj Ruam 2.
Thaum txhua yam tau teeb tsa, ESP8266 teeb tsa yuav tsum zoo li cov uas tau qhia hauv daim duab saum toj no.
Yog tias koj tuaj yeem tso cov cai yam tsis muaj qhov yuam kev, koj tuaj yeem pib sib sau ua ke.
Kauj Ruam 3: Txuas Qhov Chaw: VGA Txuas
Kuv rov hais dua kom txuas ua ntej VGA chaw nres nkoj, raws li qhia hauv cov duab saum toj no. Thov nco ntsoov tias los ntawm kev txuas peb tus lej Liab, Ntsuab thiab Xiav ua ke (piv txwv li tus pin 1, 2 thiab 3 ntawm tus txuas DSUB15), koj yuav muaj daim duab B & W ntawm koj lub vijtsam. Koj tuaj yeem muaj xim sib txawv ua ke. Saib cov ncauj lus kom ntxaws ntawm Lub Tsev Qiv Ntawv GitHub nplooj ntawv.
Ib qho ntxiv, koj yuav tsum txuas 330 Ohm resistor ntawm RGB pins thiab D7 (GPIO13) ntawm ESP8266. Qhov no muab rau kuv me ntsis greyish duab ntawm kuv lub monitor yog li, tom qab ob peb zaug sim, Kuv txiav txim siab tshem tawm nws txhua.
Txij ntawm no mus, yog txhua yam ua haujlwm tau zoo, koj tuaj yeem txuas lub monitor thiab pom lub vijtsam pib ntawm qhov kev ua si, nrog tus chij "ESP8266 VGAx Pong".
Kauj Ruam 4: Txuas Qhov Chaw: Lub Hwjchim Loj thiab Khawm
Lub pob yuav tsum txuas nrog ntawm 3.3V thiab tus pin D0 (GPIO16). Txuas kuj yog 1 txog 3 kOhm resistor los ntawm D0 rau hauv av. Qhov no zam D0 kom nyob ntawm qhov xwm txheej tsis tau txiav txim siab thaum lub pob qhib.
Kev sib txuas ntawm ob lub hwj chim muaj zog yog qhov tsis tseem ceeb, raws li qhov tseeb ESP8266 tsuas muaj qhov sib cuam tshuam nkag chaw nres nkoj A0 (ADC0)! Qhov ua kom yuam kev yog txuas ob lub pot.s cov txiaj ntsig mus rau tib lub chaw nres nkoj, thiab 'multiplex' lawv. Multiplexing yooj yim txhais tau tias koj yuav qhib lub hwj chim, nyeem nws, tom qab ntawd tua nws thiab txav mus rau qhov thib ob.
Yog tias koj xav kawm paub ntau ntxiv txog txoj hauv kev no, koj tuaj yeem nyeem Phau Ntawv Qhia no.
Txuas ib lub zog potentiometer mus rau GND, lwm qhov hnyav rau D5 rau tus neeg ua si sab laug potentiometer thiab D6 rau tus neeg uas ua yog.
Txhua lub hwj chim hauv paus tus pin yuav tsum txuas mus rau tus kheej diode, thiab lwm sab ntawm lub diodes yuav tsum txuas nrog A0 (ADC0), nrog qhov pom tseeb hauv daim duab saum toj no.
Kauj Ruam 5: Xaus thiab Txais Kev Pom Zoo
Kuv ua tsaug rau Sandro Maffiodo - SMAFFER - rau ESPVGAX libary. Qhov kev ua si no yuav ua tsis tau yog tsis muaj nws.
Kuv vam tias Cov Lus Qhia no yuav yog kev tshoov siab rau lwm tus programmer kom rov tsim dua cov kev ua si nyuaj dua qub nrog ESP8266, uas muaj kev txwv tsawg dua li Arduino.
Thaum kawg, Kuv tau sau Cov Lus Qhia no xa mus rau Kev Sib Tw Cov Khoom Ua Si: yog tias koj nyiam lossis rov tsim nws, thov siv sijhawm me ntsis los pov npav nws!
Pom zoo:
YADPF (YET Lwm Tus Duab Duab Duab): 7 Kauj Ruam (nrog Duab)
YADPF (YET Lwm Tus Duab Duab Duab): Kuv paub qhov no tsis yog khoom tshiab, Kuv paub, Kuv tau pom qee qhov ntawm cov haujlwm no ntawm no, tab sis kuv ib txwm xav tsim kuv tus kheej cov duab thav duab. Txhua daim duab thav duab kuv tau pom yog qhov zoo, tab sis kuv tab tom nrhiav lwm yam, Kuv tab tom nrhiav qhov zoo nkauj tiag tiag
Kev Tsim Qauv Duab Duab/Duab Duab Duab: 4 Kauj Ruam
Kev Tsim Qauv Duab Duab/Duab Duab Duab: Nyob zoo txhua tus, Hauv qhov kev qhia no, Kuv yuav qhia koj cov txheej txheem ntawm yuav ua li cas thiaj tsim 3D qauv siv cov duab digital. Cov txheej txheem hu ua Photogrammetry, tseem hu ua Image-Based Modeling (IBM). Tshwj xeeb, hom txheej txheem no tau siv los rov ua dua
Cov Duab Duab Duab thiab Cov Duab 1: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Cubes thiab Cov Duab 1: Thaum sim nrog qee cov ntoo ntoo thiab cov duab los qhia, kuv pom ob peb txoj hauv kev los ua cov voos thiab lwm yam duab los ntawm cov khoom siv yooj yim. Los ntawm kev muab cov no los ua Cov Ntawv Qhia, Kuv vam tias yuav txhawb nqa kev ua si thiab kev kawm. Kev hloov pauv ntawm qhov kev qhia no
Yuav Ua Li Cas Thiaj Li Tshem Tawm Lub Computer Nrog Cov Kauj Ruam Yooj Yim thiab Duab: 13 Kauj Ruam (nrog Duab)
Yuav Tsum Tshem Tawm Lub Khoos Phis Tawj Li Cas Nrog Cov Kauj Ruam Yooj Yim thiab Duab: Nov yog cov lus qhia txog yuav ua li cas tshem lub PC. Feem ntau ntawm cov khoom siv yooj yim yog hloov pauv thiab tshem tawm tau yooj yim. Txawm li cas los xij nws yog ib qho tseem ceeb uas koj tau koom nrog nws. Qhov no yuav pab tiv thaiv koj kom tsis txhob poob ib feem, thiab tseem ua rau kev rov ua dua tshiab
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: Nov yog txoj hauv kev yooj yim heev thiab tus nqi qis mus rau cov duab thav duab digital - nrog qhov zoo ntawm kev ntxiv /tshem cov duab hla WiFi ntawm 'nyem thiab luag' siv (pub dawb) xa cov ntaub ntawv . Nws tuaj yeem siv tau los ntawm qhov me me £ 4.50 Pi Zero. Koj tseem tuaj yeem hloov pauv