Cov txheej txheem:

TFT Animated Eyes: 3 Kauj Ruam
TFT Animated Eyes: 3 Kauj Ruam

Video: TFT Animated Eyes: 3 Kauj Ruam

Video: TFT Animated Eyes: 3 Kauj Ruam
Video: ESP32 TFT LCD 2.4 inch Eye Blinking Animation | 2.4 inch TFT LCD Shield | TFT LCD | ILI9341 TFT LCD 2024, Hlis ntuj nqeg
Anonim
TFT Animated Qhov Muag
TFT Animated Qhov Muag

Txoj haujlwm no siv cov nqi qis los tsim ob lub qhov muag pom ntawm TFT cov ntxaij vab tshaus. Txoj haujlwm yog ua raws Adafruit "Uncanny Eyes" project.

Ob lub ST7735 128x128 pixel cov lus qhia thiab ESP32 pawg thawj coj tuaj yeem ib txwm yuav online rau thaj tsam li $ 10 tag nrho.

Lub software khiav ntawm ESP32 yog Arduino kos duab, qhov no tau txhawb los ntawm TFT_eSPI cov tsev qiv ntawv duab. Cov duab kos yog piv txwv muab hauv TFT_eSPI lub tsev qiv ntawv.

Lwm cov txheej txheem kuj tseem tuaj yeem siv tau xws li ESP8266 thiab STM32 cov laug cam. ESP32 thiab STM32 cov txheej txheem tuaj yeem siv "Kev Ncaj Ncees Ncaj Ncees" txhawm rau hloov cov duab mus rau lub vijtsam, qhov no txhim kho kev ua tau zoo (aka tus nqi). Cov duab kos siv tus lej tseem ceeb ntawm RAM thiab FLASH qhov kev nco nco yog li nco qab qhov no thaum xaiv lub processor.

Khoom siv

Txoj haujlwm, raws li tau piav qhia, siv:

  • Ob ST7735 1.4 "128x128 TFT qhia nrog 4 xaim SPI interface
  • Ib lub ESP32 processor board
  • Creadboard thiab xov hlau
  • Arduino IDE Cov
  • TFT_eSPI lub tsev qiv ntawv version 2.3.4 lossis tom qab

Kauj Ruam 1: Kev Ua Tau Zoo

Kev Ua Tau Zoo
Kev Ua Tau Zoo

Xaiv tus processor uas koj yuav siv.

Kev ua yeeb yam zoo (fps = thav duab ib ob) rau lub qhov muag yog nyob ntawm tus txheej txheem, SPI moos tus nqi thiab seb DMA puas ua haujlwm. ESP8266 muab tus nqi qis tshaj tab sis lub qhov muag txav mus los tseem muaj kua heev.

ST7735 hom lus qhia feem ntau tuaj yeem ua haujlwm tau zoo nrog SPI moos tus nqi nce txog 27MHz. Lwm cov lus tuaj yeem ua haujlwm ntawm tus nqi siab dua, txawm li cas los xij 27MHz muab kev ua tau zoo.

Kauj ruam 2: Software Ib puag ncig

Software Ib puag ncig
Software Ib puag ncig

Arduino IDE tau siv los ua ke thiab xa cov duab kos mus rau ESP32. Nov yog qhov haujlwm tseem ceeb tshaj, yog li nws tau qhia tias koj tau txais Arduino IDE thiab ua haujlwm nrog cov piv txwv yooj yim kom dhau los paub txog ib puag ncig.

Lub pob ESP32 pawg thawj coj yuav tsum tau muab tso rau hauv IDE yog tias koj siv tus txheej txheem ntawd. Rau cov laug cam STM32 siv pob stm32duino ua haujlwm.

Lub tsev qiv ntawv duab TFT_eSPI tuaj yeem rub tawm ntawm Arduino IDE tus thawj tswj hwm lub tsev qiv ntawv.

Lub tsev qiv ntawv TFT_eSPI muab 2 qhov piv txwv rau qhov muag pom:

  • Animated_Eyes_1 yog piv txwv rau ib qho zaub (240 x 320 pixels yam tsawg kawg nkaus)
  • Animated_Eyes_2 yog ib qho piv txwv rau ob qho lus

Txoj haujlwm no siv qhov piv txwv thib ob.

Yog tias koj twb yog tus siv lub tsev qiv ntawv TFT_eSPI thiab muaj 240x320 (lossis loj dua) tso saib ua haujlwm kom raug ces Animated_Eyes_1 yuav khiav yam tsis muaj kev hloov pauv thiab tso ob lub qhov muag pom ntawm ib qho screen.

Kauj Ruam 3: Zaub Txuas

Zaub Txuas
Zaub Txuas

Tus qauv tau tsim los ntawm ntsaws ESP32 thiab nthuav tawm rau hauv cov ntawv ci thiab siv cov hlua txuas. Qhov no yooj yim rau kev sim ua ntej tab sis muaj feem cuam tshuam tsis zoo tshwj xeeb yog tias txav mus. Nws lub qhov muag yuav tsum tau siv ua ib feem ntawm kev hnav khaub ncaws ces siv tag nrho cov kev sib txuas tau pom zoo.

Feem ntau TFT nti xaiv kab rau ib qho lus qhia tau teev tseg hauv tus neeg siv _ teeb tsa cov ntaub ntawv ntawm TFT_eSPI lub tsev qiv ntawv, txawm li cas los xij thaum siv lub tsev qiv ntawv nrog ob qhov kev nthuav qhia lub nti xaiv yuav tsum raug tswj los ntawm daim duab, yog li koj yuav tsum tsis txhob txhais lub TFT_CS tus pin hauv TFT_eSPI cov ntaub ntawv teeb tsa tsev qiv ntawv. Hloov chaw, tus xaiv xaiv (CS) yuav tsum tau txhais nyob hauv "config.h" tab ntawm Animated_Eyes_2 kos duab.

Lub tsev qiv ntawv TFT_eSPI siv "cov ntaub ntawv user_setup" txhawm rau txheeb xyuas txhua qhov ntsuas tsis zoo rau cov zaub, lub khoos phis tawj thiab cuam tshuam, rau Animated_Eyes_2 kos duab "Setup47_ST7735.h" cov ntaub ntawv tau siv nrog cov hlua raws li tau hais los saum no.

Cov lus siv los ntsuas yog 128x128 ST7735 cov lus, TFT_eSPI cov tsev qiv ntawv teeb tsa cov ntaub ntawv yuav xav tau hloov pauv raws li cov lus pom los hauv ntau yam kev hloov pauv.

Thaum nws yog txhua txoj haujlwm thiab ua haujlwm nws tuaj yeem raug tshem tawm ntawm lub khoos phis tawj thiab siv los ntawm lub xov tooj them roj teeb pob uas muaj USB tso tawm.

Pom zoo: