Cov txheej txheem:

Npaum thiab Pheej Yig: Zaub Nrog STM32L4: 13 Cov Kauj Ruam
Npaum thiab Pheej Yig: Zaub Nrog STM32L4: 13 Cov Kauj Ruam

Video: Npaum thiab Pheej Yig: Zaub Nrog STM32L4: 13 Cov Kauj Ruam

Video: Npaum thiab Pheej Yig: Zaub Nrog STM32L4: 13 Cov Kauj Ruam
Video: Tus Neeg Ruam - R-Lin Thoj | New Song [ Official MV ] Nkauj Tawm Tshiab 2023 Hmong Song 2023 2024, Kaum ib hlis
Anonim
Image
Image
Taw qhia
Taw qhia

Hnub no, peb yuav tham txog peb yam uas kuv nyiam tshaj plaws: cov duab LCD uas siv lub zog me me, STM32 nrog Core Arduino, thiab Arduino Mega Pro Mini. Nov yog qhov tsis txaus ntseeg trio rau Internet ntawm Yam. Kuv mam li qhia koj rau HT1621 rau-tus lej LCD zaub thiab tsim qhov piv txwv tswj nrog tus lej uas ua haujlwm ntawm ob qho Arduino Mega Pro Mini thiab STM32 L432KC. Cov ntsiab lus tseem ceeb yog tias qhov chaws rau ob lub microcontrollers zoo ib yam. Kuv yuav tsis hloov tus pinning ib yam. Nws yog qhov zoo heev kiag li!

Kauj ruam 1: Taw qhia

Taw qhia
Taw qhia

HT1621 LCD zaub muaj lub vijtsam uas siv ntau zaus, ntsuas hluav taws xob, moos hluav taws xob, ntsuas cua sov, thiab ntsuas ntsuas hluav taws xob.

• Nws muaj 6 tus lej nrog 7 ntu

• Nws siv 3-xaim SPI kev sib txuas lus

• Nws muaj lub teeb pom kev zoo uas haum rau ib puag ncig tsaus ntuj

• Nws qhov hluav taws xob ua haujlwm yog 4.7 ~ 5.2V

• Nws siv 4mA nrog lub teeb pom kev zoo

Nco ntsoov tias nws muaj ntau dua SIX tus lej, Peb lub ntsiab lus sib tw, thiab ntsuas lub roj teeb nrog THREE tuav.

Kauj ruam 2: Tsev qiv ntawv rau Siv

Peb yuav siv ANXZHU github cov neeg siv tsev qiv ntawv, uas yog qhov yooj yim heev. Nws tuaj yeem pom hauv qhov qub version hauv qhov txuas hauv qab no:

github.com/anxzhu/seg-lcd-with-ht1621

Lub tsev qiv ntawv lub npe yog qhov txawv me ntsis, yog li kuv txiav txim siab hloov nws (cov ntaub ntawv, chav kawm, tus tsim khoom, thiab lwm yam). Nws lub npe qub yog "A6seglcd". Kuv hloov lub npe no nrog "lcdlib".

Kauj ruam 3: Tsev qiv ntawv

Ntxiv cov tsev qiv ntawv "lcdlib".

Nkag mus rau qhov txuas thiab rub lub tsev qiv ntawv.

Unzip cov ntawv thiab muab tso rau hauv cov ntawv qiv ntawm Arduino IDE.

C: / Program Files (x86) / Arduino / qiv

Kauj Ruam 4: Qhia tawm

Qhia tawm
Qhia tawm

Arduino mega los ua ke

Kauj Ruam 5: Qhia tawm

Qhia tawm
Qhia tawm

SMT32 sib dhos

Kauj Ruam 6: STM32 NUCLEO-L432KC

STM32 NUCLEO-L432KC
STM32 NUCLEO-L432KC

Kuv xav hais meej ntawm no tias STM32-L432KC tsis muaj tus hloov pauv USB. Hloov chaw, nws muaj USB tag nrho, uas siv STMicroelectronics ST-txuas raws tu qauv. Yog li, nws yog qhov ntse heev thiab ua kom muaj txiaj ntsig debugging yog tias koj siv IR lossis Microvision. Thiab yog Arduino Core (MBED, siv Microsoft lub cuab yeej ib txwm muaj), nws siv cov kws tshaj lij sau ua ke. Kuv puas xav hais lwm yam ntxiv?

Kauj Ruam 7: Arduino Mega 2560 PRO MINI

Arduino Mega 2560 PRO MINI
Arduino Mega 2560 PRO MINI

Kuv kuj nyiam qhov no, vim nws yog "dawb huv" thiab "tiag tiag" Arduino. Nws yog Mega, nrog ntau IOs. Tab sis nws yog Mini, yog li nws haum rau txhua qhov chaw. Kuv nyiam IO txhua qhov txhia chaw. Nrog rau qhov no, Kuv nyiam txuas Led, SPI, i2c, thiab lwm yam Hauv qhov kev hwm no, Mega no zoo heev.

Kauj Ruam 8: Sib dhos

Los ua ke
Los ua ke

Hauv peb qhov kev sib dhos, kab ntawm tus txiv neej tus pin nyob sab hauv, thaum tus poj niam tus pin nyob sab nraud sab nraud, ua kom yooj yim rau peb txoj haujlwm thiab txuas nrog tus tiv thaiv. Peb ua SPI kev txuas, nco ntsoov tias Arduino Mega thiab Arduino Nano clone muaj tib tus pinning, uas yog STM32-L432KC.

Kauj Ruam 9: Txoj Haujlwm

Peb yuav ua qhov haujlwm yooj yim heev, qhov twg peb yuav sau ntau lub cim (ntawv, tus lej, thiab cov ntsiab lus) ntawm cov zaub.

Nco ntsoov tias txoj haujlwm no ua haujlwm ntawm ob qho Arduino Mega Pro Mini thiab STM32 L432KC.

Kauj Ruam 10: Cov tsev qiv ntawv thiab qhov txawv

Tom qab ntawd peb yuav suav nrog lub tsev qiv ntawv lub luag haujlwm rau kev sib txuas lus thiab cuam tshuam sai sai ntawm kev tswj hwm cov zaub. Qhov "const char" muaj nuj nqi nthuav tawm cov lus array. Nws yog los ntawm cov vectors uas koj yuav ua rau siv tus yam ntxwv uas luam tawm ntawm cov zaub.

#suav nrog // biblioteca para controle do display

lcd lib; // instancia do controlador do display /*0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, b, C, c, d, E, F, H, h, L, n, N, P, r, t, U, -, puav, pf, '', */ const char num = {0x7D, 0x60, 0x3E, 0x7A, 0x63, 0x5B, 0x5F, 0x70, 0x7F, 0x7B, 0x77, 0x4F, 0x1D, 0x0E, 0x6E, 0x1F, 0x17, 0x67, 0x47, 0x0D, 0x46, 0x75, 0x37, 0x37, 0x06, 0x0F, 0x6D, 0x02, 0x80, 0xFF, 0x00}; / *indice num 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 */

Kauj ruam 11: Teeb tsa

Txhawm rau pib teeb tsa, peb yuav txhais cov pins, ua qhov pib teeb tsa, thiab teeb tsa cov khoom ntxuav. Peb txiav txim siab tias cov zaub tso tawm "Nyob Zoo," thiab tom qab qee lub sijhawm qeeb, cov lus tso tawm tau raug tshem tawm.

teeb tsa tsis muaj dab tsi () {lcd.run (2, 3, 4, 5); // [cs wr cov ntaub ntawv coj+] cov ntsiab lus dosos lcd.conf (); // configuração inicial lcd.clr (); // limpa o display // escreve HELLO lcd.display (10, num [17]); lcd.display (8, num [15]); lcd.display (6, num [19]); lcd.display (4, num [19]); lcd.display (2, num [0]); // fim HELLO ncua (1000); lcd.clr (); // limpa o tso saib}

Kauj ruam 12: Loop

Ntawm no, peb tsim txoj haujlwm hu ua "writeLoop," uas yuav sau lo lus LOOP ntawm lub vijtsam, tom qab ntawd sau txhua lub cim ntawm peb cov cim.

Thaum kawg, peb muaj lo lus "lcd.dispnum" uas sau tus nqi taw tes ntab.

Kauj Ruam 13: Rub Cov Ntaub Ntawv

PDF

INO

Pom zoo: