Cov txheej txheem:

TTGO (xim) Zaub Nrog Micropython (TTGO T-display): 6 Cov Kauj Ruam
TTGO (xim) Zaub Nrog Micropython (TTGO T-display): 6 Cov Kauj Ruam

Video: TTGO (xim) Zaub Nrog Micropython (TTGO T-display): 6 Cov Kauj Ruam

Video: TTGO (xim) Zaub Nrog Micropython (TTGO T-display): 6 Cov Kauj Ruam
Video: Модуль TTGO VGA32 2024, Hlis ntuj nqeg
Anonim
TTGO (xim) Zaub Nrog Micropython (TTGO T-zaub)
TTGO (xim) Zaub Nrog Micropython (TTGO T-zaub)
TTGO (xim) Zaub Nrog Micropython (TTGO T-zaub)
TTGO (xim) Zaub Nrog Micropython (TTGO T-zaub)

TTGO T-Display yog pawg thawj coj raws ESP32 uas suav nrog 1.14 nti xim zaub. Lub rooj tsavxwm tuaj yeem yuav khoom plig tsawg dua 7 $ (suav nrog kev xa khoom, khoom plig pom ntawm banggood). Qhov ntawd yog qhov khoom plig zoo kawg rau ESP32 suav nrog cov zaub.

Qhov no tuaj yeem yog lub hauv paus zoo tshaj rau koj txoj haujlwm tom ntej. Unfourtunatly, tsuas muaj kev txhawb nqa rau arduino xwb.

Micropython muaj ntau qhov zoo, nws ua rau txhim kho txoj haujlwm kom yooj yim dua. Kuv yuav tsis piav lawv txhua tus ntawm no. Muaj ntau qhov zoo hauv youtube cov vis dis aus hais txog yuav ua li cas micropyhton ua rau koj lub neej yooj yim dua thiab yam txias uas koj tuaj yeem ua nrog nws.

Hmoov tsis zoo, qhov kev txhawb nqa raug cai tsuas yog siv "lus arduino".

Hauv qhov kev qhia no kuv yuav qhia koj yuav siv lub rooj tsav xwm nrog micropython li cas.

Kauj Ruam 1: Nruab Loboris Firmware ntawm Pawg Thawj Coj

Lub micropython ua haujlwm tsis muaj kev txhawb nqa rau cov zaub zoo li no. Koj yuav tsum teeb tsa loboris micropython. Nov yog qhov hloov pauv txias heev micropython nrog kev tso tawm ntxiv.

Txhawm rau teeb tsa, yooj yim ua raws li kuv (yooj yim) Kev qhia ib qib zuj zus

https://www.instructables.com/id/Installing-Loboris-lobo-Micropython-on-ESP32-With-/

Kauj Ruam 2: Thauj Cov Qauv Qauv

Ntsuas Cov Qauv Cai
Ntsuas Cov Qauv Cai
Ntsuas Cov Qauv Cai
Ntsuas Cov Qauv Cai

Txuas koj lub rooj tsavxwm nrog uPyCraft raws li tau piav qhia hauv kev teeb tsa kev qhia. Yog li tau piav qhia, thaum koj tau pib uPyCraft, koj nyem cov cuab yeej-> Serial-> COM7 (hloov COM7 nrog qhov chaw nres nkoj koj pom thaum lub sijhawm teeb tsa kev qhia). Tam sim no tej zaum yuav qhib lub qhov rai nrog "Flash firmware" lossis qee yam zoo li ntawd. Tsis txhob ua li ntawd! Qhov no yog yuam kev. Cias kaw qhov "flash firmware" window thiab txuas dua nrog cov cuab yeej-> Serial-> COM7. Tam sim no koj yuav tsum pom ">>>" hauv koj lub qhov rai hais kom ua. Qhov no txhais tau tias koj txuas nrog ua tiav.

Tam sim no koj qhib lub cuab yeej (ntawm sab laug) thiab ob npaug nias rau ntawm "main.py". Yog tias cov ntaub ntawv no tsis muaj nyob, tsim nws. Muab tshuaj txhuam cov cai hauv qab no hauv lub qhov rais:

ntshuam tshuab, tso saib, sijhawm, lej, network, siv sijhawm

tft = display. TFT () tft.init (tft. ST7789, bgr = False, rot = tft. LANDSCAPE, miso = 17, backl_pin = 4, backl_on = 1, mosi = 19, clk = 18, cs = 5, dc = 16)

tft.setwin (40, 52, 320, 240)

rau kuv hauv ntau (0, 241):

xim = 0xFFFFFF-tft.hsb2rgb (i/241*360, 1, 1)

tft.line (i, 0, i, 135, xim)

tft.set_fg (0x000000)

tft.ellipse (120, 67, 120, 67)

tft.line (0, 0, 240, 135)

text = "ST7789 nrog micropython!"

tft.text (120-int (tft.textWidth (ntawv nyeem)/2), 67-int (tft.fontSize () [1]/2), ntawv, 0xFFFFFFF

wifi = network. WLAN (network. STA_IF) wifi.active (True) wifi.connect ("yourWlan", "yourPassword") utime.sleep_ms (3000) network.telnet.start (neeg siv = "m", password = "m ")

Nws yog ib qho tseem ceeb kom muaj qhov nkag mus rau ob kab hauv qab "rau" cov lus pom. Txheeb daim duab kom pom tias nws zoo ib yam.

Tam sim no nws yog lub sijhawm los khiav nws! Txuag cov ntawv, thiab nias F5 (lossis nyem rau ntawm Cov Cuab Yeej-> downloadAndRun). Tam sim no koj yuav tsum pom qee yam ntawm koj cov zaub. Yog tias nws yog qee yam coj txawv txawv, koj yuav tsum nias lub pob pib dua ntawm ib sab ntawm lub rooj tsavxwm. Tam sim no koj cov zaub yuav tsum zoo li ntawm daim duab.

Hauv cov kauj ruam tom ntej kuv yuav piav qhia txoj cai.

Kauj ruam 3: Pib ua ntej

Ok, koj twb muaj txhua yam koj xav tau lawm. Tam sim no kuv yuav mus ib kauj ruam zuj zus hla txoj cai thiab piav qhia nws.

Thov saib hauv cov ntaub ntawv zoo heev ntawm

github.com/loboris/MicroPython_ESP32_psRAM…

rau cov ntaub ntawv ntxiv

ntshuam tshuab, tso saib, sijhawm, lej, network, siv sijhawm

tft = display. TFT ()

tft.init (tft. ST7789, bgr = False, rot = tft. LANDSCAPE, miso = 17, backl_pin = 4, backl_on = 1, mosi = 19, clk = 18, cs = 5, dc = 16)

tft.setwin (40, 52, 320, 240)

Cov khoom lag luam yuav tsum meej. Kab thib peb intitialises cov zaub.

Yog tias koj xav tua lub vijtsam, tsuas yog khiav tft.init dua nrog backl_on = 0

Kab plaub teev teev cov ciam teb zaub. Qhov no yog qhov tsim nyog vim tias kev ua haujlwm tsis yog rau qhov pom tseeb no. Yog tias koj tsis ua qhov no, koj kos sab nraum cov zaub.

Cheeb tsam koj siv tau yog (0, 0, 135, 240)

Kauj Ruam 4: Teeb duab thiab Xim

Qhov tseem ceeb tshaj plaws ua ntej: Cov xim tau ntxeev! Koj tuaj yeem ua tau tam sim no RGB (yuav ua li cas xim tau qhia nrog tus lej). Liab yuav ib txwm yog 0xFF0000. Tab sis ntawm no, rau liab koj yuav tsum siv 0x00FFFF. Rau xiav koj yuav tsum siv 0xFFFF00 thiab lwm yam.

Loboris muaj xim tsis tu ncua. Lawv yog inverted heev. Yog tias koj xav siv lawv koj tuaj yeem hloov lawv:

tft.set_bg (0xFFFFFF - tft. BLUE)

tft.clear ()

Qhov no ua rau qhov screen xiav. Kev rho tawm cov xim uas koj xav tau los ntawm 0xFFFFFF hloov lawv thiab koj tau txais cov xim uas koj xav tau.

rau kuv hauv ntau (0, 241): xim = 0xFFFFFF-tft.hsb2rgb (i/241*360, 1, 1)

tft.line (i, 0, i, 135, xim)

tft.set_fg (0x000000)

tft.ellipse (120, 67, 120, 67)

tft.line (0, 0, 240, 135) ntawv = "ST7789 nrog micropython!" tft.text (120-int (tft.textWidth (ntawv nyeem)/2), 67-int (tft.fontSize () [1]/2), ntawv, 0xFFFFFFF

Rau-lub voj tsim cov xim hue gradient. Qhov peb xaiv cov xim peb xav kos nrog (dawb) thiab peb kos lub ellipse, kab thiab kab ntawv.

Kauj ruam 5: Telnet

wifi = network. WLAN (network. STA_IF) wifi.active (Muaj tseeb)

wifi.connect ("yourWlan", "yourPassword")

utime.sleep_ms (3000)

network.telnet.start (neeg siv = "m", password = "m")

Qhov no pib telnet sever. Koj tuaj yeem hla lub rooj tsav xwm hla koj li WLAN yam tsis txuas nws ntawm USB! Qhov no muaj txiaj ntsig zoo yog tias koj muaj txoj haujlwm uas koj tsis tuaj yeem nkag mus tau yooj yim rau koj lub rooj tsavxwm.

Txhawm rau nkag mus dhau WLAN koj yuav tsum xub paub seb IP ntawm pawg thawj coj saib yog dab tsi. Txuas koj lub rooj tsavxwm ntawm USB. Hloov "yourWlan" nrog koj lub npe WLAN thiab "yourPassword" nrog koj tus password. Download tau thiab khiav. Nkag mus rau "network.telnet.status ()" hauv lub qhov rai hais kom ua thiab nias nkag mus. Nws yuav tsum xa tus IP ntawm pawg thawj coj saib.

Kuv rov hais qhia koj lub cuab yeej "Putty" kom nkag tau los ntawm telnet. Nws yog freeware. Rub tawm, nruab thiab qhib nws. Xaiv telnet rau hom kev txuas, sau tus IP koj pom thiab nyem qhib. Qhov rai qhib. ID nkag mus raws li "m", nias nkag mus. Nws nug tus password. Nias m thiab nkag mus. Tam sim no koj yuav tsum tau txuas nrog ntawm telnet.

Kauj Ruam 6: Ua Koj Tus Kheej Txoj Haujlwm Zoo

Qhov ntawd yog nws! Nrog cov cai no raws li hauv paus koj tuaj yeem tsim koj tus kheej txoj haujlwm tsis txaus ntseeg.

Ob peb yam hais txog:

-Loboris tseem muaj peev xwm teeb tsa ftp server. Nrog rau qhov no thiab telnet koj tuaj yeem tso lossis hloov kho tus lej thiab khiav nws. Ua tiav txoj cai los ntawm koj lub chaw nres tsheb huab cua sab nraud los ntawm koj lub rooj zaum yam tsis muaj kev sib txuas ntawm lub cev. Zoo kawg!

-Loboris muaj Wiki zoo heev:

github.com/loboris/MicroPython_ESP32_psRAM…

Txuas ncaj qha rau cov zaub Wiki:

github.com/loboris/MicroPython_ESP32_psRAM…

Txuas ncaj qha rau telnet Wiki:

github.com/loboris/MicroPython_ESP32_psRAM…

Kuv vam tias koj pom cov ntawv qhia no muaj txiaj ntsig. Tawm koj cov lus tawm thiab qhia peb tias koj tau ua dab tsi nrog TTGO thiab micropython

Pom zoo: