Try   HackMD
tags: Arduino Lcd I2C

Lcd monitor with I2C interface

intro

Normally, lcd can be connected with Arduino with many wires. With the I2C transfer module, we can use the I2C interface with only 4 wires to connect to your Arduino board.

code

You can find the library in the built-in Arduino libraries manerger or use the expension library below. But you need to notice the little difference between the defult one and the expension one.
LiquidCrystal I2C

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • defult wire pinout:
GND Vcc SDA SCL
GND 5V A4 A5

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • defult wire on Mega2560:
GND Vcc SDA SCL
GND 5V A20 A21
#include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display void setup() { lcd.init(); // initialize the lcd lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); //(posision,line) lcd.print("Hellow World!"); } void loop(){ }

ref

【自造學堂】Arduino如何透過I2C控制LCD模組
【Leon知識領域】LCD I2C 液晶顯示模組