Cov txheej txheem:

Qhov tsis txaus ntseeg ESP32 Wrover Los Ntawm Espressif: 8 Kauj Ruam
Qhov tsis txaus ntseeg ESP32 Wrover Los Ntawm Espressif: 8 Kauj Ruam

Video: Qhov tsis txaus ntseeg ESP32 Wrover Los Ntawm Espressif: 8 Kauj Ruam

Video: Qhov tsis txaus ntseeg ESP32 Wrover Los Ntawm Espressif: 8 Kauj Ruam
Video: Tsis Tau Txaus Koj | Kong Chue (Official Music Video) 2024, Hlis ntuj nqeg
Anonim
Image
Image
Nta Tseem Ceeb
Nta Tseem Ceeb

Hnub no, Kuv yuav los qhia koj rau ESP32 Wrover Kit, uas yog tus qauv uas txawv dua li ESP32 Kuv feem ntau siv (chav dej). Wrover yog pawg thawj coj txhim kho uas muaj ntau yam ntxwv thiab yog ib puag ncig zoo heev. Kuv yuav qhia koj qhov piv txwv ntawm txoj haujlwm nrog ESP32 Wrover Kit uas cuam tshuam nrog kev sau ntawm cov zaub thiab SD Card, nrog rau cov duab.

Kauj ruam 1: Taw qhia

ESP32-Wrover-Kit muaj ntau yam tshwj xeeb tshaj li ESP32 tus qauv. Hauv cov khoom siv no, peb tau teeb tsa 3.2 LCD zaub, ua kom nrawm Micro-SD daim npav sib cuam tshuam, thiab VGA lub koob yees duab sib cuam tshuam. I / O pins raug tshem tawm ntawm ESP32 tus qauv kom yooj yim txuas ntxiv.

Lub Rooj Tswjhwm Saib kuj tseem muaj cov lej sib txuas ntau tus lej USB txuas (FTDI FT2232HL), uas tso cai rau cov tsim khoom siv JTAG ncaj qha los daws teeb meem ESP32 ntawm USB interface.

Kauj Ruam 2: Cov Ntais Tseem Ceeb

Nta Tseem Ceeb
Nta Tseem Ceeb

• 240 MHz Dual Core CPU

• 4MB SPI PSRAM (zoo li pseudo ram)

• Built-in USB-JTAG debugger

• LCD zaub SPI 3.2"

• Micro-SD daim npav interface

• VGA lub koob yees duab interface

• Kev nthuav dav ntawm I / Os

www.espressif.com/en/products/hardware/esp-wrover-kit/overview

Ntawm no, em duab thib ob, Kuv piav qhia cov yam ntxwv ntawm tus qauv no.

Kauj Ruam 3: Qhia tawm

Qhia tawm
Qhia tawm

Kauj ruam 4: ESP32 Wrover

ESP32 Cov
ESP32 Cov

Kauj ruam 5: Tsev qiv ntawv

Rub tawm WROVER_KIT_LCD

lub tsev qiv ntawv kom nkag tau rau lub LCD saib.

Kev rub tawm tuaj yeem ua tiav los ntawm qhov txuas:

github.com/espressif/WROVER_KIT_LCD/archive/master.zip

Unzip hauv daim nplaub tshev../Documents/Arduino/libraries/

Kauj ruam 6: Upload

Upload
Upload

Txhawm rau xa cov phiaj xwm mus rau pawg thawj coj, peb yuav tsum xaiv Adafruit ESP32 Feather board.

Kauj Ruam 7: Txoj Haujlwm

Koj tuaj yeem siv cov piv txwv los ntawm WROVER_KIT_LCD lub tsev qiv ntawv los ntsuas lub rooj tsavxwm. Rau kev qhia, peb yuav suav peb qhov piv txwv. Qhov no yuav koom nrog kev sau / kos duab ntawm lub vijtsam thiab SD daim npav.

Cov Tsev Qiv Ntawv thiab Ntau Yam

Tom qab ntawd peb yuav suav nrog cov tsev qiv ntawv. Ob: esp_wp1.h thiab esp_wp2.h, uas yog vectors, thiab kuv tawm ntawm qhov rub tawm txuas ntawm no thiab thaum kawg ntawm kab lus no. Peb instantiate lub luag hauj lwm lub luag hauj lwm rau kev tswj ntawm cov zaub thiab ua ib tug tshuaj ntsuam muaj nuj nqi tswj.

#include "SPI.h" #include "Adafruit_GFX.h" #include "WROVER_KIT_LCD.h" // lib de controle do display #include // lib de controle do micro-SD #include "esp_wp1.h" // imagem em HEX #include "esp_wp2.h" // imagem em HEX WROVER_KIT_LCD tft; // objeto responsável pelo controle do display int screen = 0; // controle de tela

Teeb

Pib cov zaub thiab pleev xim rau tag nrho lub vijtsam nrog cov xim uas xav tau.

teeb tsa tsis muaj dab tsi () {Serial.begin (115200); tft.begin (); // inicializa o display} // pinta toda a tela com a cor desejada void clearScreen (int xim) {tft.fillScreen (xim); // pinta toda a tela}

Loop

Peb tig cov canvas mus rau toj roob hauv pes, uas yuav hloov pauv raws li kev tswj sib txawv. Yog li yog tias kuv xaiv qhov hloov pauv rooj 0, cov ntawv yuav raug sau rau ntawm qhov screen. Hauv qhov piv txwv ntawm kev hloov rooj plaub 1, peb luam cov ntaub ntawv los ntawm SD cov duab thiab HEX cov duab los ntawm cov ntaub ntawv (#suav nrog).

lub voj void (tsis muaj dab tsi) {tft.setRotation (1); // rotaciona para toj roob hauv pes // muda a tela de acordo com a variável de controle (screen) switch (screen) {case 0: writeText (); // escreve textos de diferentes na tela so; rooj plaub 1: writeImages (); // printa arquivos de imagens do SD e imagens HEX dos arquivos (#include) so; default: npo = -1; tawg; // volta pra tela inicial} screen ++; }

sau ntawv ()

Nthuav tawm ib feem ntawm txoj cai, peb cuam tshuam nrog kev pleev xim ntawm lub vijtsam thiab tus cursor tso rau hauv keeb kwm thiab qhov loj ntawm qhov chaw.

// escreve textos de diferentes na telavoid writeText () {clearScreen (WROVER_BLACK); // pinta toda a tela tft.setCursor (0, 0); // posiciona o cursor na origem tft.setTextColor (WROVER_WHITE); tft.setTextSize (1); // tamanho da fonte-1 tft.println ("Testando ESP32-WROVER-KIT"); tft.println (); tft.setTextColor (WROVER_YELLOW); tft.setTextSize (2); // tamanho da fonte - 2 tft.println ("Youtube | Instagram |"); tft.println ("Telegram | Facebook |"); tft.println ("Rooj sab laj"); tft.println (); tft.setTextColor (WROVER_RED); tft.setTextSize (3); // tamanho da fonte - 3 tft.println ("Acesse:"); tft.println (); tft.setTextColor (WROVER_GREENYELLOW); tft.setTextSize (4); // tamanho da fonte - 4 tft.println ("FERNANDOK. COM"); ncua (2000); }

sauImages ()

Hauv txoj haujlwm no, peb pib ua daim npav SD thiab sau ob daim ntawv-j.webp

// printa arquivos de imagens do SD e imagens HEX dos arquivos (#include) void writeImages () {clearScreen (WROVER_WHITE); // inicializa o cartão SD card Serial.print ("Initializing SD card …"); yog (! SD_MMC.begin ()) {Serial.println ("ua tsis tiav!"); rov qab; } Serial.println ("OK!"); tft.drawJpgFile (SD_MMC, "/fk_logo.jpg", 50, 50); // escreve um arquivo-j.webp

Kauj ruam 8: Cov ntaub ntawv

Rub tawm cov ntawv:

PDF

INO

esp_wp1.h

esp_wp2.h

Pom zoo: