Yuav Ua Li Cas Txuas Cov LCD LCD Rau Nokia 5110 Rau Arduino

Cov txheej txheem:

Yuav Ua Li Cas Txuas Cov LCD LCD Rau Nokia 5110 Rau Arduino
Yuav Ua Li Cas Txuas Cov LCD LCD Rau Nokia 5110 Rau Arduino

Video: Yuav Ua Li Cas Txuas Cov LCD LCD Rau Nokia 5110 Rau Arduino

Video: Yuav Ua Li Cas Txuas Cov LCD LCD Rau Nokia 5110 Rau Arduino
Video: Arduino и Nokia 5110 - подключение и руссификация 2024, Kaum ib hlis
Anonim

Cia peb xam seb yuav txuas li cas rau 84x48 pixel kua siv lead ua kua los ntawm Nokia 5110 rau Arduino.

Cov zaub LCD rau Nokia 5110
Cov zaub LCD rau Nokia 5110

Tsim nyog

  • - Arduino;
  • - Cov ntxaij vab tshaus LCD rau Nokia 5110/3310;
  • - txuas xov hlau.

Cov Lus Qhia

Kauj ruam 1

Cia peb txuas lub vijtsam LCD ntawm Nokia 5110 rau Arduino raws li daim duab hauv qab no.

Daim duab sib txuas ntawm Nokia 5110 LCD npo rau Arduino
Daim duab sib txuas ntawm Nokia 5110 LCD npo rau Arduino

Kauj ruam 2

Ntau lub tsev nyeem ntawv tau raug sau los ua haujlwm nrog LCD npo no. Kuv xav hais kom siv ib qho no: https://www.rinkydinkelectronics.com/library.php?id=44 (rub daim LCD5110_Basic.zip).

Txhawm rau nruab, unzip cov ntawv rau hauv Arduino IDE / cov chaw qiv / cov npe.

Cov tsev nyeem ntawv txhawb cov haujlwm zoo li hauv qab no.

LCD5110 (SCK, MOSI, DC, RST, CS); - tshaj tawm ntawm LCD npo qhia txog kev sib teb rau lub pins ntawm Arduino;

InitLCD ([sib piv]); - kev pib ntawm 5110 cov zaub nrog kev ntsuas xaiv tau ntawm kev sib piv (0-127), lub neej ntawd yog 70;

setContrast (sib piv); - teev qhov sib piv (0-127);

enableSleep (); - muab tso rau qhov kev tshuaj ntsuam mus rau hom pw tsaug zog;

disableSleep (); - coj lub vijtsam tawm ntawm hom pw tsaug zog;

clrScr (); - clears cov npo;

clrRow (kab, [pib], [xaus]); - tshem tus kab xaiv xaiv kab, los ntawm txoj haujlwm pib mus rau qhov kawg;

invert (tseeb); thiab rov qab los (tsis tseeb); - tig mus thiab tawm inversion ntawm cov ntsiab lus ntawm LCD npo;

luam tawm (hlua, x, y); - qhia txog ib txoj hlua ntawm cov cim nrog cov kev tswj tshwj xeeb; hloov x-kev sib koom tes, koj tuaj yeem siv LEFT, CENTER thiab RIGHT; qhov siab ntawm daim qauv txheem yog 8 ntsiab lus, yog li cov kab yuav tsum tau sauv ntawm 8 lub ntsiab lus;

printNumI (tooj, x, y, [ntev], [muab tub lim]; - muab tso rau ib qho lej ntawm qhov screen ntawm txoj hauj lwm (x, y); ntev - qhov xav tau ntev ntawm tus naj npawb; muab tub lim - tus ua cim los sau "voids" yog tias tus lej tsawg dua qhov xav tau ntev; lub neej ntawd yog qhov chaw khoob ";

printNumF (tooj, txiav txim siab, x, y, [divider], [ntev], [muab tub lim]; - teeb pom tus naj npawb floating; kev txiav txim - cov naj npawb ntawm cov zauv xaus; divider - zauv xaus, teev "." los ntawm neej ntawd;

setFont (npe); - xaiv ib tus tsiaj ntawv; cov ntawv sau ua muaj npe hu ua SmallFont thiab TinyFont; koj tuaj yeem txhais koj cov fonts hauv cov duab kos;

invertText (muaj tseeb); thiab invertText (cuav); - cov ntawv inversion rau / tawm;

drawBitmap (x, y, cov ntaub ntawv, sx, sy); - muab cov duab tso rau ntawm qhov screen ntawm lub x thiab y; cov ntaub ntawv - ib qho array uas muaj daim duab; sx thiab sy yog qhov dav thiab qhov siab ntawm daim duab.

Kauj ruam 3

Cia sau li sketch. Ua ntej, peb suav nrog lub tsev qiv ntawv, tom qab ntawd peb tshaj tawm piv txwv ntawm chav kawm LCD5110 nrog qhov chaw ua haujlwm pin.

Hauv kev teeb tsa () cov txheej txheem, peb pib ua haujlwm LCD npo.

Hauv cov voj voos () cov txheej txheem, peb tshem tawm lub vijtsam thiab sau cov ntawv sau lub suab nyiam hauv ib tus ntawv me me, hauv qab nws, hauv cov ntawv sau nruab nrab, tso rau ntawm txee ntawm vib nas this.

Kos duab rau kev tso saib cov lus ntawm LCD npo Nokia 5110
Kos duab rau kev tso saib cov lus ntawm LCD npo Nokia 5110

Kauj ruam 4

Cia peb pom ib daim duab. Txhawm rau ua qhov no, cia peb npaj monochrome duab uas peb xav tso tawm rau ntawm Nokia 5110. Nco ntsoov tias lub vijtsam daws teeb meem yog 48 los ntawm 84 pixels, thiab daim duab yuav tsum tsis txhob loj dua. Ntawm nplooj ntawv https://www.rinkydinkelectronics.com/t_imageconverter_mono.php hloov daim duab kom haum me ntsis. Rub tawm cov ntaub ntawv tawm nrog "*.c" txuas ntxiv thiab ntxiv nws rau qhov project los ntawm cov ntawv qhia zaub mov: Kos duab -> Ntxiv Cov Ntaub Ntawv … lossis tsuas muab cov ntawv tso rau hauv cov duab kos taw qhia thiab tom qab ntawd thau Arduino IDE.

Ntxiv cov duab thov rau koj qhov project Arduino
Ntxiv cov duab thov rau koj qhov project Arduino

Kauj ruam 5

Tam sim no koj yuav tsum tshaj tawm ib qho kev sib dhos nrog cov ntaub ntawv duab hauv qhov program code (hauv kuv tus lej no yog kab kab uint8_t mysymb;), thiab tom qab ntawd siv drawBitmap () muaj nuj nqi los tso saib cov duab hauv qhov chaw xav tau ntawm lub vijtsam.

Nthuav cov duab hauv lub vijtsam LCD Nokia 5110
Nthuav cov duab hauv lub vijtsam LCD Nokia 5110

Kauj Ruam 6

Tso cov duab kos rau Arduino. Tam sim no cov ntawv hloov pauv los ntawm daim duab, thiab cov txee nce nws cov nqi txhua zaus.

Pom zoo: