// --------------------------------------------------------------------------------
/*

15 顯示文字訊息到 LCD 顯示屏

[學習重點]

1. 認識 LCD Display
LiquidCrystal_I2C Repo
https://github.com/johnrickman/LiquidCrystal_I2C

2. 認識 I2C
Arduino Boarf I2C Pin
https://www.arduino.cc/reference/en/language/functions/communication/wire/

[挑戰]

- 加入一些之前學過的感應器並將讀取到的數值顯示到 LCD 上


Created by Jason on 15 Aug 2022.

*/
// --------------------------------------------------------------------------------

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup() {
  lcd.init(); // 啟動 LCD
  lcd.backlight();

  // 顯示文字訊息到 LCD
  lcd.setCursor(5,0); // 設定遊標位置 (左邊數第幾個字, 行數)
  lcd.print("Welcome to"); // 在遊標位置顯示文字
  lcd.setCursor(3,1);
  lcd.print("Jason Workshop");
   lcd.setCursor(1,2);
  lcd.print("Arduino in 30 days");
   lcd.setCursor(5,3);
  lcd.print("Challenge!");
}

void loop() {
}