Cov txheej txheem:

LCD 1602 Nrog Arduino Uno R3: 6 Cov Kauj Ruam
LCD 1602 Nrog Arduino Uno R3: 6 Cov Kauj Ruam

Video: LCD 1602 Nrog Arduino Uno R3: 6 Cov Kauj Ruam

Video: LCD 1602 Nrog Arduino Uno R3: 6 Cov Kauj Ruam
Video: LCD1602 - это очень просто! 2024, Kaum ib hlis
Anonim
LCD 1602 Nrog Arduino Uno R3
LCD 1602 Nrog Arduino Uno R3

Hauv zaj lus qhia no, peb yuav kawm paub siv LCD1602 los tso saib cov cim thiab cov hlua. LCD1602, lossis 1602 tus cwj pwm-hom kua siv lead ua kua, yog hom dot matrix module los qhia cov tsiaj ntawv, tus lej, thiab cim thiab ntxiv rau. Nws suav nrog 5x7 lossis 5x11 dot matrix txaus qhia; txhua txoj haujlwm tuaj yeem tso saib ib tus cim. Muaj qhov sib tw ntawm ob tus cim thiab qhov chaw nruab nrab ntawm kab, yog li cais cov cim thiab kab. Tus lej 1602 txhais tau tias ntawm cov zaub, 2 kab tuaj yeem pom thiab 16 tus cim hauv txhua tus. Tam sim no cia saib cov ncauj lus kom ntxaws!

Kauj Ruam 1: Cheeb Tsam:

- Arduino Uno board * 1

- USB cable * 1

- LCD1602 *1

Potentiometer (50kΩ)* 1

- Daim phiaj * 1

- Jumper xov hlau

Kauj Ruam 2: Txoj Cai

Feem ntau, LCD1602 muaj cov chaw nres nkoj sib xws, uas yog, nws

yuav tswj ntau tus pin tib lub sijhawm. LCD1602 tuaj yeem raug cais ua yim-chaw nres nkoj thiab plaub-chaw txuas. Yog tias yim-qhov chaw txuas tau siv, tom qab ntawd tag nrho cov chaw nres nkoj digital ntawm Arduino Uno board yuav luag tag nrho. Yog tias koj xav txuas ntau lub ntsuas cua, yuav tsis muaj chaw nres nkoj muaj. Yog li ntawd, plaub-chaw nres nkoj txuas tau siv ntawm no rau daim ntawv thov zoo dua.

Pins ntawm LCD1602 thiab lawv cov haujlwm

VSS: txuas nrog hauv av

VDD: txuas nrog lub zog +5V

VO: txhawm rau kho qhov sib txawv

RS: Sau npe xaiv tus pin uas tswj hwm qhov twg hauv LCD lub cim xeeb koj tab tom sau cov ntaub ntawv rau. Koj tuaj yeem xaiv ob qho ntaub ntawv sau npe, uas tuav dab tsi mus rau ntawm lub vijtsam, lossis daim ntawv qhia sau npe, uas yog qhov LCD tus tswj xyuas saib rau cov lus qhia yuav ua dab tsi ntxiv.

R/W: Nyeem/Sau tus pin los xaiv ntawm hom nyeem ntawv thiab sau ntawv

E: Ib tus lej txuas uas nyeem cov ntaub ntawv thaum tau txais Qib Siab (1). Cov lus qhia tau khiav thaum lub teeb liab hloov pauv los ntawm Qib Siab rau Qib qis.

D0-D7: nyeem thiab sau cov ntaub ntawv

A thiab K: Pins uas tswj lub teeb nraub LCD. Txuas K rau GND thiab A rau 3.3v. Qhib lub teeb nraub qaum thiab koj yuav pom cov cim meej nyob hauv ib puag ncig tsaus ntuj.

Kauj Ruam 3: Daim Duab Schematic

Schematic Daim duab
Schematic Daim duab

Kauj ruam 4: Cov txheej txheem

Txuas K rau GND thiab A mus rau 3.3 V, thiab tom qab ntawd teeb pom kev zoo ntawm LCD1602 yuav raug qhib. Txuas VSS rau GND thiab LCD1602 rau lub zog siv. Txuas VO mus rau tus pin nruab nrab ntawm lub hwj chim - nrog nws koj tuaj yeem kho qhov sib txawv ntawm qhov screen. Txuas RS rau D4 thiab R/W tus pin rau GND, uas txhais tau tias tom qab ntawd koj tuaj yeem sau cov cim rau LCD1602. Txuas E rau tus pin6 thiab cov cim tso tawm ntawm LCD1602 raug tswj los ntawm D4-D7. Txog rau kev ua haujlwm, nws tau ua kom zoo los ntawm kev hu xov tooj ua haujlwm.

Kauj ruam 1:

Tsim lub voj voog.

Kauj ruam 2:

Rub tawm cov cai los ntawm

Kauj ruam 3:

Tshaj tawm cov duab kos rau Arduino Uno board

Nyem rau Upload icon txhawm rau upload cov cai rau pawg tswj hwm.

Yog tias "Ua tiav uploading" tshwm rau hauv qab ntawm lub qhov rais, nws txhais tau hais tias daim duab tau ua tiav tiav.

Nco tseg: koj yuav xav tau kho lub hwj chim ntawm lub LCD1602 kom txog thaum nws tuaj yeem pom meej.

Kauj ruam 5: Code

Code
Code

Cov duab LCD1602

// Koj yuav tsum tam sim no

pom koj lub LCD1602 tso cov cim ntws "PRIMEROBOTICS" thiab "nyob zoo, ntiaj teb"

// Web site: www.primerobotics.in

#suav nrog

// suav nrog lub tsev qiv ntawv chaws

/**********************************************************/

char

array1 = "PrimeRobotics"; // txoj hlua los luam tawm ntawm LCD

char

array2 = "nyob zoo, ntiaj teb!"; // txoj hlua los luam tawm ntawm LCD

int sij =

250; // tus nqi ncua sijhawm

// pib lub tsev qiv ntawv

nrog tus lej ntawm tus pin interface

Ua kua

lcd (4, 6, 10, 11, 12, 13);

/*********************************************************/

void teeb tsa ()

{

lcd.begin (16, 2); // teeb tsa LCD tus lej ntawm kab thiab

kab:

}

/*********************************************************/

void lub voj ()

{

lcd.setCursor (15, 0); // teeb tus cursor rau kab 15, kab 0

rau (int positionCounter1 = 0;

positionCounter1 <26; positionCounter1 ++)

{

lcd.scrollDisplayLeft (); // Scrolls tus txheem ntawm cov zaub ib

qhov chaw rau sab laug.

lcd.print (array1 [positionCounter1]); // Luam tawm cov lus rau LCD.

ncua (tim); // tos 250 microseconds

}

lcd.clear (); // Tshem tawm lub vijtsam LCD thiab ua haujlwm

tus cursor nyob rau sab saud sab laug.

lcd.setCursor (15, 1); // teeb tus cursor rau kab 15, kab 1

rau (int positionCounter2 = 0;

positionCounter2 <26; positionCounter2 ++)

{

lcd.scrollDisplayLeft (); // Scrolls tus txheem ntawm cov zaub ib

qhov chaw rau sab laug.

lcd.print (array2 [positionCounter2]); // Luam tawm cov lus rau LCD.

ncua (tim); // tos 250 microseconds

}

lcd.clear (); // Tshem tawm lub vijtsam LCD thiab tso rau

tus cursor nyob rau kaum kaum sab saud.

}

/**********************************************************/

Pom zoo: