카테고리 없음

아두이노 LCD

ahhang0k 2021. 6. 16. 16:19

아두이노에서 스케치에서 라이브러리 포함하기에서 라이브러리 관리하기를 들어가 Liquid Crystal I2C를 다운받는다

파일에서 예제에서 Hello World 들어가기

//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h> 
#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();                      // initialize the lcd 
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(3,0);
 
  lcd.print("Hello, world!");
  lcd.setCursor(2,1);
  lcd.print("Ywrobot Arduino!");
   lcd.setCursor(0,2);
  lcd.print("Arduino LCM IIC 2004");
   lcd.setCursor(2,3);
  lcd.print("Power By Ec-yuan!");
}


void loop()
{
}

저항값이 너무 높거나 낮으면 LCD의 화면이 잘 안보일수 있다. 그러므로 LCD 뒷판을 드라이버로 돌려보자