Cov txheej txheem:

Nokia 5110 LCD Nrog Infrared Sensor: 4 Kauj Ruam
Nokia 5110 LCD Nrog Infrared Sensor: 4 Kauj Ruam

Video: Nokia 5110 LCD Nrog Infrared Sensor: 4 Kauj Ruam

Video: Nokia 5110 LCD Nrog Infrared Sensor: 4 Kauj Ruam
Video: NOKIA 5110. Работа с графическим дисплеем 2024, Kaum ib hlis
Anonim
Nokia 5110 LCD Nrog Infrared Sensor
Nokia 5110 LCD Nrog Infrared Sensor

Nokia 5110 LCD zaub yog qhov zoo tshaj plaws LCD zaub uas tau sib xws nrog Arduino kev txhim kho

pawg thawj coj saib. Cia peb tam sim no tswj ib qho ntawm cov LCDs thiab cuam tshuam nrog Arduino thiab IR sensor

Kauj Ruam 1: Qhov Yuav Tsum Tau

Yam Yuav Tsum Tau
Yam Yuav Tsum Tau

Cov hauv qab no xav tau rau txoj haujlwm no:

1) Arduino Nano

2) Infrared sensor

3) Nokia 5110 lcd screen

4) Jumper xov hlau

5) Daim ntawv qhia zaub mov

Kauj Ruam 2: Txuas Cov Hluav Taws Xob

Txuas Cov Xov
Txuas Cov Xov

Txuas cov xov hlau raws li no:

Arduino rau LCD:

CLK = 8, DIN = 4, CE = 7, DC = 5, RST = 6

Arduino mus rau:

Tawm = 2, gnd = gnd, vcc = 5v

Kauj ruam 3: Code:

#suav nrog "U8glib.h"

int ib = 2; tus x;

// Npaj los ntawm Sourya Choudhury.

// Credits-Henry's Bench tutorials for lcd tutorial.

U8GLIB_PCD8544 u8g (8, 4, 7, 5, 6);

// CLK = 8, DIN = 4, CE = 7, DC = 5, RST = 6

void kws sau ntawv ()

{

x = digitalRead (ib);

yog tias (x == HIGH)

{u8g.setFont (u8g_font_profont12);

u8g.setPrintPos (0, 15);

u8g.print ("Txoj Kev Zoo!");

ncua (100);

}

lwm tus

{

u8g.setFont (u8g_font_profont12);

u8g.setPrintPos (0, 15);

u8g.print ("Txoj Kev Thaiv!");

ncua (100);

}

}

void teeb tsa ()

{

pinMode (a, INPUT);

}

void voj () {

u8g.firstPage ();

ua {

tus kws sau ntawv ();

} thaum (u8g.nextPage ());

}

Kauj ruam 4: Txaus siab rau !!!!!!

Txaus siab rau !!!!!!!!
Txaus siab rau !!!!!!!!

Thov pov npav rau txoj haujlwm no rau kev sib tw Microcontroller!

Pom zoo: