Cov txheej txheem:

I2C LCD ntawm NodeMCU V2 Nrog Arduino IDE: 3 Cov Kauj Ruam
I2C LCD ntawm NodeMCU V2 Nrog Arduino IDE: 3 Cov Kauj Ruam

Video: I2C LCD ntawm NodeMCU V2 Nrog Arduino IDE: 3 Cov Kauj Ruam

Video: I2C LCD ntawm NodeMCU V2 Nrog Arduino IDE: 3 Cov Kauj Ruam
Video: Подключение дисплея 1602 lcd i2c. 1602 ардуино дисплей 2024, Kaum ib hlis
Anonim
I2C LCD ntawm NodeMCU V2 Nrog Arduino IDE
I2C LCD ntawm NodeMCU V2 Nrog Arduino IDE

Hauv qhov kev qhia sai no kuv yuav qhia koj li cas noj su LCD nrog I2C Serial Adapter ntawm NodeMCU v2 siv ArduinoIDE thiab muaj cov tsev qiv ntawv.

Kauj Ruam 1: Yuav Tsum Xeem thiab Software

Kho vajtse:

1. NodeMCU v2

2. 16x2 LCD Zaub nrog i2c Serial Interface Adapter Module

3. Qee qhov xov hlau, USB rau lub hwj chim muab thiab kos duab rub tawm

Software:

1. ArduinoIDE -

2. Lub tsev qiv ntawv LiquidCrystal_I2C-https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

Kauj ruam 2: Teeb Kho Vajtse

Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb

Kev npaj:

Thaum koj xaj LCD los ntawm Ali/ebay koj tuaj yeem siv tau 16 tus pin headers rau LCD zaub txhawm rau zam kom tsis txhob 'xaim xov' thaum txuas mus rau cov khoom sib txuas

Teeb:

  1. Muab cov zaub LCD thiab Cov Txuas Txuas rau ntawm lub rooj noj mov ib sab ntawm ib sab
  2. Txuas tus adapter SCL tus pin nrog NodeMCU D1 tus pin
  3. Txuas tus adapter SDA tus pin nrog NodeMCU D2 tus pin
  4. Txuas tus adapter GND, VCC pins nrog NodeMCU GND, Vin raws li - ntawm no kuv xav piav qhia ib yam. Yeej koj yuav tsum txuas LCD zaub rau 5v qhov chaw tab sis NodeMCU tsuas muaj 3.3v tso tawm kom LCD zoo nkauj heev. Yog tias koj muab LCD nrog lwm 5v qhov chaw koj yuav xav tau siv lub logic qib hloov pauv vim tias nws yuav tsis ua haujlwm. Nov kuv tau siv qee qhov hack siv USB muab lub zog uas hla dhau rau Vin. Nws yog 5V tab sis nws ua haujlwm:)

Kauj ruam 3: Sketch

Daim Duab
Daim Duab

Kev npaj:

  1. Nruab ArduinoIDE
  2. Ntxiv NodeMCU kev txhawb nqa - zoo piav qhia ntawm no.
  3. Ntxiv LiquidCrystal_I2C lub tsev qiv ntawv - thov siv cov lus qhia los ntawm tus sau. Kev teeb tsa los ntawm AdruinoIDE yuav ntxiv qhov qub dhau los

Daim duab:

#suav nrog

#suav nrog

LiquidCrystal_I2C lcd (0x27, 16, 2);

void teeb tsa () {

Serial.begin (115200);

// Siv tus lej PINS uas tau npaj ua ntej

Wire.begin (D2, D1);

lcd.begin ();

lcd.home ();

lcd.print ("Nyob zoo, NodeMCU");

}

void loop () {// tsis ua dab tsi ntawm no}

Rub tawm daim duab kos thiab koj ua tiav!

Pom zoo: