메뉴 건너뛰기

정보자료게시판

장비/디자인/구조

[아두이노] ESP32 - LCD 연결하기

by 라키 posted Nov 24, 2018
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

[아두이노] ESP32 - LCD 연결하기

목표

ESP32 - LCD 연결하기

제어 테스트 소스

/*********
  Rui Santos
  Complete project details at https://randomnerdtutorials.com  
*********/

#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&#39;t know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);  

void setup(){
  // 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("Hello, World!");
  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(); 
}

준비

  • LiquidCrystal_I2C 라이브러리를 다운받아야 함
  • VIN - VCC, GND - GND, D21 - SDA, D22 - SCL 연결함. VCC를 3V3에 연결하면 전압이상으로 제대로 동작 안함

참고한 자료

</liquidcrystal_i2c.h


위로