LCD(Liquid Crystal Display) En: 두 판 사이의 차이

아두위키 : Arduwiki
편집 요약 없음
편집 요약 없음
1번째 줄: 1번째 줄:
[[File:1602LCD대표이미지1.jpg|center|class=coders70]]
[[File:1602LCDimg1.jpg|center|class=coders70]]
[[File:1602LCD대표이미지2.jpg|center|class=coders70]]It's a module for controlling a 16x2 LCD with just four wires via I2C communication.  
[[File:1602LCDimg2.jpg|center|class=coders70]]It's a module for controlling a 16x2 LCD with just four wires via I2C communication.  


The I2C address is mostly [0x27], but there are occasional exceptions, so it's recommended to check the address before use.
The I2C address is mostly [0x27], but there are occasional exceptions, so it's recommended to check the address before use.

2024년 4월 2일 (화) 15:06 판

It's a module for controlling a 16x2 LCD with just four wires via I2C communication.

The I2C address is mostly [0x27], but there are occasional exceptions, so it's recommended to check the address before use.

Specifications and Required Hardware

  • Operating Voltage: 5V
  • 16x2 LCD I2C MODULE
  • Arduino UNO
  • UNO Cable
  • F-M Cable (4ea)

Libraries

  • Wire (No need to install as it's a default library.)
  • LiquidCrystal I2C

Connections

I2C LCD Arduino UNO
GND GND
VCC 5V
SDA A4
SCL A5

How to Check the Address

You can verify the address by uploading the following code and then running the Serial Monitor.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup()
{  
  // Initialize the LCD before use.
  lcd.init();

  // Turn on the LCD backlight.
  lcd.backlight();
  
  // Set the LCD cursor position to (0,0) (top left corner).
  lcd.setCursor(0, 0);

  // Write the text to display.
  lcd.print("Gongzipsa");

  // Move the LCD cursor to position (0,1).
  lcd.setCursor(0, 1);

  // Print the value of val.
  int val = 1004;
  lcd.print(val);
}

void loop(){}

Example Code

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup()
{  
  // Initialize the LCD before use.
  lcd.init();

  // Turn on the LCD backlight.
  lcd.backlight();
  
  // Set the LCD cursor position to (0,0) (top left corner).
  lcd.setCursor(0, 0);

  // Write the text to display.
  lcd.print("Gongzipsa");

  // Move the LCD cursor to position (0,1).
  lcd.setCursor(0, 1);

  // Print the value of val.
  int val = 1004;
  lcd.print(val);
}

void loop(){}

Example Code Result:

Additional Information

The brightness of the LCD text can be adjusted by controlling the variable resistor.