Difference between revisions of "WeMOS: D1 R1 mini LCD I2C Contoh Lagi"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "Sumber: https://microdigisoft.com/how-to-use-i2c-lcd-with-esp8266-wemos-d1-mini/ Download * https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip /* I2C...")
 
 
Line 33: Line 33:
 
   lcd.setCursor(0, 0);
 
   lcd.setCursor(0, 0);
 
   // print message
 
   // print message
   lcd.print("WELL-COME TO");
+
   lcd.print("Welcome");
 
   //delay(1000);
 
   //delay(1000);
 
   // clears the display to print new message
 
   // clears the display to print new message
Line 39: Line 39:
 
   // set cursor to first column, second row
 
   // set cursor to first column, second row
 
   lcd.setCursor(0,1);
 
   lcd.setCursor(0,1);
   lcd.print("MICRODIGISOFT");
+
   lcd.print("Hello World!");
 
   delay(1000);
 
   delay(1000);
 
   lcd.clear();  
 
   lcd.clear();  

Latest revision as of 17:34, 25 March 2023

Sumber: https://microdigisoft.com/how-to-use-i2c-lcd-with-esp8266-wemos-d1-mini/

Download


/*
 I2C LCD	ESP8266-Wenos D1 Mini
 GND	        GND
 VCC	        VIN
 SDA	        D2
 SCL	        D1
*/
#include < LiquidCrystal_I2C.h >

// set the LCD number of columns and rows
int lcdColumns = 16;
int lcdRows = 2;

// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);  

void setup(){
  lcd.begin(5, 4);// initialize LCD
  lcd.init();
  // turn on LCD backlight                      
  lcd.backlight();
}

void loop(){
  // set cursor to first column, first row
  lcd.setCursor(0, 0);
  // print message
  lcd.print("Welcome");
  //delay(1000);
  // clears the display to print new message
  //lcd.clear();
  // set cursor to first column, second row
  lcd.setCursor(0,1);
  lcd.print("Hello World!");
  delay(1000);
  lcd.clear(); 
}


Referensi