Difference between revisions of "WeMOS: D1 R1 mini LCD I2C Hello World"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | Sumber: https://www.esp8266learning.com/wemos-mini-i2c-lcd-example.php | ||
+ | |||
[[File:Wemos-and-i2c-lcd bb.webp|center|400px|thumb]] | [[File:Wemos-and-i2c-lcd bb.webp|center|400px|thumb]] | ||
Line 6: | Line 8: | ||
D2 SDA | D2 SDA | ||
D1 SCL | D1 SCL | ||
+ | |||
+ | Download Library | ||
+ | * http://www.esp8266learning.com/wp-content/uploads/2017/12/LiquidCrystal_I2C-master.zip | ||
+ | * https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip | ||
Code | Code | ||
Line 20: | Line 26: | ||
#include <LiquidCrystal_I2C.h> | #include <LiquidCrystal_I2C.h> | ||
− | LiquidCrystal_I2C lcd( | + | LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x3F for |
a 16 chars and 2 line display | a 16 chars and 2 line display | ||
void setup() | void setup() | ||
{ | { | ||
− | + | lcd.init(); // initialize the lcd | |
− | + | lcd.init(); | |
− | + | // Print a message to the LCD. | |
− | + | lcd.backlight(); | |
− | + | lcd.setCursor(0,0); | |
− | + | lcd.print("Hello world"); | |
− | + | lcd.setCursor(1,0); | |
− | + | lcd.print("ESP32 I2C LCD"); | |
} | } | ||
− | void loop() | + | void loop(){ |
− | |||
} | } | ||
+ | |||
+ | |||
+ | ==Referensi== | ||
+ | |||
+ | * https://www.esp8266learning.com/wemos-mini-i2c-lcd-example.php |
Latest revision as of 16:41, 27 March 2023
Sumber: https://www.esp8266learning.com/wemos-mini-i2c-lcd-example.php
Wemos Mini LCD1602 GND GND 3v3 VCC D2 SDA D1 SCL
Download Library
- http://www.esp8266learning.com/wp-content/uploads/2017/12/LiquidCrystal_I2C-master.zip
- https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip
Code
/* Wemos Mini LCD1602 GND GND 3v3 VCC D2 SDA D1 SCL */ #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x3F for a 16 chars and 2 line display void setup() { lcd.init(); // initialize the lcd lcd.init(); // Print a message to the LCD. lcd.backlight(); lcd.setCursor(0,0); lcd.print("Hello world"); lcd.setCursor(1,0); lcd.print("ESP32 I2C LCD"); } void loop(){ }