#include "LiquidCrystal_I2C_Hangul.h"
// I2C库 使用方法见 https://www.bilibili.com/video/BV1RM4y1a7J5?t=461.2&p=16
//创建 LiquidCrystal_I2C_Hangul 对象,变量名为lcd
LiquidCrystal_I2C_Hangul lcd(0x27, 16, 2);
void setup() {
lcd.init(); //初始化
lcd.backlight(); //打开背光
lcd.print("Hello World"); //打印字符
Serial.begin(115200); //初始化串口通信
}
void loop() {
if(Serial.available()) {
delay(100);
lcd.clear(); //清除屏幕
while(Serial.available()) {
lcd.write(Serial.read());
}
}
delay(16);
}