Another illustration that demonstrate how to wire the i2c 16×2 LCD on ESP8266 12 Known as NodeMCU, as you can see the diagram below the SCL as Arduino Analog Pin A4 is connected to D1 on NodeMCU at the same time the D2 as the SDA represent as Analog Pin A5 on Arduino Board, As you may notice that the sketch code that we used it is not LUA script it is actually standard Arduino C compiled/Interpret by Arduino IDE. If you don’t have an ESP8266 runs on Arduino IDE please follow this link.
Required Devices
- NodeMCU 12,12E
- LCD16x2 on i2C Module
- Jumper Wires / DuPont Wires
Wiring Diagram
Sketch Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/*
14CORE NodeMCU i2C 16×2 LCD SCREEN
Test COde…………………….
*/
#include <Wire.h> // This library is already built in to the Arduino IDE
#include <LiquidCrystal_I2C.h> //This library you can add via Include Library > Manage Library >
LiquidCrystal_I2C lcd(0x3F, 20, 4);
void setup()
{
lcd.init(); // initializing the LCD
lcd.backlight(); // Enable or Turn On the backlight
lcd.setCursor(0, 1);
lcd.print(“14CORE | 16×2 LCD TEST”); // Start Print text to Line 1
lcd.setCursor(0, 2);
lcd.print(“———————–“); // Start Print Test to Line 2
}
void loop()
{
// Nothing Absolutely Nothing!
}
|