Cov txheej txheem:
- Kauj Ruam 1: Cov Khoom Siv
- Kauj ruam 2: Zaub
- Kauj Ruam 3: SSD1306 Library
- Kauj Ruam 4: Cov Animation thiab XBM Cov Ntaub Ntawv
- Kauj Ruam 5: Tawm XBM Cov Ntaub Ntawv
- Kauj ruam 6: Source Code
- Kauj Ruam 7: Ua UpLoad of Code
- Kauj ruam 8: Cov ntaub ntawv
Video: Taw qhia ESP32 Lora OLED Zaub: 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Nov yog lwm cov vis dis aus hais txog Kev Taw Qhia rau ESP32 LoRa. Lub sijhawm no, peb yuav hais lus tshwj xeeb txog cov duab nraaj (ntawm 128x64 pixels). Peb yuav siv SSD1306 lub tsev qiv ntawv los nthuav qhia cov ntaub ntawv ntawm OLED cov duab no thiab nthuav qhia piv txwv ntawm cov duab siv XBM cov duab.
Kauj Ruam 1: Cov Khoom Siv
1 Heltec WiFi LoRa 32
Protoboard
Kauj ruam 2: Zaub
Cov zaub siv ntawm pawg thawj coj loj yog OLED ntawm 0.96 nti.
Nws muaj 128x64 thiab yog monochrome.
Nws muaj I2C kev sib txuas lus thiab txuas nrog ESP32 ntawm 3 xov hlau:
SDA ntawm GPIO4 (rau cov ntaub ntawv)
SCL ntawm GPIO15 (rau moos)
RST ntawm GPIO16 (rau rov pib dua thiab pib pom)
Kauj Ruam 3: SSD1306 Library
Qhov no tuaj yeem pom ua ke nrog teeb tsa cov tsev qiv ntawv muab los ntawm Heltec-Aaron-Lee.
Nws muaj ntau txoj haujlwm rau sau cov hlua, kos kab, duab plaub, lub voj voos, thiab tso duab.
github.com/Heltec-Aaron-Lee/WiFi_Kit_series
Kauj Ruam 4: Cov Animation thiab XBM Cov Ntaub Ntawv
Peb yuav siv lub tsev qiv ntawv kosXbm ua haujlwm los tso saib cov tsiaj ntawv.
XBM cov duab hom muaj cov kab ntawv ntawm cov cim uas txhua lub ntsiab lus sawv cev rau ib txheej ntawm cov xim ib txwm (1 me ntsis txhua), los ntawm tus lej hexadecimal. Cov no yog sib npaug rau ib byte.
Vim tias ntau tus cim tau siv los sawv cev rau ib qho byte nkaus xwb, cov ntaub ntawv no zoo li loj dua li cov uas tau siv tam sim no. Qhov zoo dua yog lawv tuaj yeem suav sau ncaj qha yam tsis xav tau kev kho mob ua ntej.
Ntxiv rau qhov array, ob qhov chaw uas txiav txim siab cov duab loj tau suav nrog.
Txhawm rau tsim cov duab, peb xav tau cov duab uas yuav tsim cov thav duab.
Peb tuaj yeem siv cov software kho duab los ua haujlwm. Tsuas yog kev ceev faj peb yuav tsum tau ua yog ua ntej khaws qhov loj sib xws nrog cov zaub thiab siv cov ntaub ntawv monochrome.
Txhawm rau tsim cov ntaub ntawv, peb tuaj yeem kos lawv lossis rub cov duab. Ntawm no, peb txiav txim siab kho cov duab xim siv PaintBrush, thiab peb kos txhua tus ntawm tus thav duab
Thawj daim duab - 960x707 pixels - hom ntawv PNG
Cov kauj ruam tom ntej yog ua kom nws monochrome los ntawm kev txuag nws ua monochrome bitmap.
Tom qab ntawd, peb hloov nws mus rau qhov loj me sib xws nrog cov zaub.
Them nyiaj tshwj xeeb rau cov ntsuas ntsuas. Hauv qhov no, peb hloov kho cov duab kom nws nyob tag nrho qhov siab ntawm cov zaub (ntsug = 64 pixels).
Nrog cov duab hauv qhov loj me, peb yuav kho nws kom tsim cov thav duab. Ntawm no, peb tab tom tshem tawm txhua lub arc ntawm qib teeb liab thiab txuag lawv raws qhov sib xws.
Tam sim no, peb yuav tsum hloov cov ntaub ntawv BMP rau XBM hom.
Muaj ntau txoj kev xaiv software uas tuaj yeem ua qhov kev hloov pauv no. Peb kuj tau xaiv GIMP ua tus xaiv xaiv.
Hauv peb qhov piv txwv, peb siv PaintBrush los tsim thiab kho cov ntaub ntawv. Txawm li cas los xij, txhua qhov ntawm cov txheej txheem no tuaj yeem ua tiav hauv Gimp (lossis lwm yam kev hloov kho).
Txhawm rau hloov pauv, peb xub qhib cov ntawv.
Nrog daim duab qhib, peb tuaj yeem xaiv Cov Ntaub Ntawv => Export li …
Hauv qhov Export Image window, peb yuav tsum hloov cov ntaub ntawv txuas ntxiv mus rau XBM. Gimp yuav yog tus saib xyuas lub hom phiaj xav tau thiab nthuav qhia ntau txoj hauv kev…
Thaum xa tawm, Gimp yuav nthuav qhia lwm txoj hauv kev. Peb tuaj yeem tawm qhov txiaj ntsig qub.
Tom qab hloov tag nrho cov ntaub ntawv, peb yuav muaj plaub XBM cov ntaub ntawv, ib qho rau txhua tus ncej.
Tam sim no cia peb theej lawv mus rau qhov chaws cim npe thiab hloov lawv los ntawm kev hloov lawv qhov txuas mus rau.h.
Kauj Ruam 5: Tawm XBM Cov Ntaub Ntawv
Peb tuaj yeem qhib XBM cov ntaub ntawv hauv ib qho ntawv kho lus, qhov uas peb yuav pom cov duab sib piv thiab cov ntaub ntawv cov duab loj uas twb tau hais tseg lawm.
Kauj ruam 6: Source Code
Source Code: Cov nqe lus
Peb yuav suav nrog cov tsev qiv ntawv tsim nyog, ntxiv rau cov ntaub ntawv duab. Peb txhais cov haujlwm ntawm daim duab thiab ncua sijhawm hloov pauv. Peb kuj taw tes OLED pins txuas nrog ESP32. Thaum kawg, peb tsim thiab kho cov khoom pom.
// Incluindo as bibliotecas necessárias #include #include "SSD1306.h" // Incluindo os arquivos de imagem #include "frame1.h" #include "frame2.h" #include "frame3.h" #include "frame4.h" // definições de posição da imagem e intervalo de transição #define posX 21 #define posY 0 #define intervalo 500 // Pinos ua OLED estão conctados ao ESP32: I2C // OLED_SDA - GPIO4 // OLED_SCL - GPIO15 // OLED_RST - - GPIO16 #define SDA 4 #define SCL 15 #define RST 16 // O RST deve ser controlado por software SSD1306 zaub (0x3c, SDA, SCL, RST); // Cria e ajusta o Objeto zaub
Source Code: Teeb ()
Pib cov zaub thiab ntxeev ntsug ntawm lub vijtsam. Kev ua yog xaiv tau.
teeb tsa tsis muaj dabtsis () {display.init (); // inicia o tso saib display.flipScreenVertically (); // inverte verticalmente a tela (xaiv tau)}
Tau qhov twg los Code: Loop ()
Thawj qhov ua hauv lub voj yog tshem qhov screen. Peb thauj tus ncej 1 mus rau qhov tsis siv posX thiab posY thawj txoj haujlwm. Peb qhia qhov loj me ntawm daim duab nrog frame1_width thiab frame1_height, thiab lub npe ntawm cov kab uas muaj cov khoom me me ntawm daim duab. Peb qhia qhov tsis nyob ntawm cov zaub thiab tos rau ib ntus ua ntej qhia tus ncej tom ntej.
lub voj void () {display.clear (); // limpa tela // carrega para o buffer o frame 1 // usando as posições iniciais posX e posY // informa o tamanho da imagem com frame1_width e frame1_height // informa o nome da matriz que contem os bits da imagem, no caso frame1_bits display.drawXbm (posX, posY, frame1_width, frame1_height, frame1_bits); // mostra o tsis muaj zaub display.display (); // aguarda um intervalo antes de mostrar o próximo thav duab ncua (intervalo);
Peb rov ua cov txheej txheem rau tag nrho lwm cov thav duab.
// rov ua dua cov txheej txheem rau todos os outros thav duab display.clear (); display.drawXbm (posX, posY, frame2_width, frame2_height, frame2_bits); display.display (); ncua (intervalo); display.clear (); display.drawXbm (posX, posY, frame3_width, frame3_height, frame3_bits); display.display (); ncua (intervalo); display.clear (); display.drawXbm (posX, posY, frame4_width, frame4_height, frame4_bits); display.display (); ncua (intervalo); }
Kauj Ruam 7: Ua UpLoad of Code
Nrog rau IDE qhib, qhib cov ntaub ntawv nrog rau qhov chaws los ntawm ob npaug nias rau.ino cov ntawv, lossis los ntawm kev mus rau Cov Ntawv qhia zaub mov.
Nrog Heltec txuas nrog USB, xaiv cov cuab yeej ntawv qhia zaub mov => Daim npav: "Heltec_WIFI_LoRa_32"
Tseem nyob hauv Cov cuab yeej ntawv qhia zaub mov, xaiv COM chaw nres nkoj uas Heltec txuas nrog.
Nyem rau UPLOAD khawm…
… Thiab tos txog qhov xaus.
Kauj ruam 8: Cov ntaub ntawv
Rub tawm cov ntawv:
INO
Pom zoo:
LED Qhov Taw Qhia Qhov Taw Qhia Tus Menyuam: 5 Kauj Ruam (nrog Duab)
LED Qhov Taw Qhia Qhov Taw Qhia Tus dev: Kuv ib txwm coj kuv tus dev Rusio mus taug kev thaum lub hnub poob qis kom nws tuaj yeem ua si yam tsis tau kub heev. Qhov teeb meem yog tias thaum nws tawm ntawm txoj hlua qee zaum nws tau zoo siab heev thiab ua haujlwm ntau dua li nws yuav tsum thiab nrog lub teeb qis thiab lwm tus dev
Yuav Ua Li Cas Thiaj Li Taw Qhia Qhov Taw Qhia: 6 Kauj Ruam
Yuav Ua Li Cas Thiaj Li Qhia Tus Kheej: Lub hom phiaj tseem ceeb ntawm daim ntawv thov no yog txhawm rau ntsuas qhov hnyav ntawm ib yam khoom tom qab ntawd qhia nrog lub tswb nrov thaum muaj qhov hnyav dhau. Cov tswv yim ntawm lub kaw lus los ntawm lub xov tooj ntawm tes. Kev tawm tswv yim yog lub teeb liab sib piv uas tau nthuav dav los ntawm qhov sib txawv
Loj hlob Zaub Zaub Ntxiv Hauv Qhov Chaw Tsawg Los Yog Loj hlob Zaub Zaub Hauv Chaw, (Ntau lossis Tsawg): 10 Kauj Ruam
Loj Hlob Ntau Cov Zaub Zaub Hauv Tsawg Chaw lossis … Loj hlob Zaub Zaub Hauv Chaw, (Ntau lossis Tsawg).: Qhov no yog kev tshaj lij tshaj lij rau Kev Loj Hlob Tshaj Ntiaj Teb, Kev Tsim Khoom Sib Tw, xa los ntawm Cov Lus Qhia. Kuv tsis tuaj yeem muaj kev zoo siab dua los tsim rau thaj chaw cog qoob loo thiab tshaj tawm kuv thawj Cov Lus Qhia. Yuav pib, kev sib tw nug peb kom
Chaw Zaub Zaub Zaub Qhia Tau Zoo- Airline High School Robotics: 8 Kauj Ruam
Space Lettuce Chamber Instructable- Airline High School Robotics: Nov yog Kev Qhia Ua los ntawm peb tus tub ntxhais kawm theem siab cuv npe hauv chav kawm neeg hlau. Peb yuav tsim chav rau cog cov zaub xas lav hauv qhov chaw rau Kev Loj Hlob Tshaj Ntiaj Teb Kev Sib Tw los ntawm NASA. Peb tab tom yuav qhia koj yuav tsim lub thawv li cas. Cia peb
Kev Taw Taw Taw Tswj 5 Gallon Dej Dispenser: 3 Kauj Ruam
Tus Kheej Tus Kheej Tus Kheej 5 Gallon Dej Tso Dej: Hauv qee lub tebchaws zoo li qhov kuv nyob (Qaib ntxhw), peb muaj teeb meem nrog lub twj tso kua mis kom xa dej tawm ntawm lub ntim. Qee lub twj tso kua mis yog qhov nyuaj thiab cov menyuam yaus muaj teeb meem nrog kev muab lub zog xav tau. Yog li kuv xav txog kev siv ko taw