Arduino
Ви бажаєте відреагувати на цей пост? Створіть акаунт всього за кілька кліків або увійдіть на форум.

Модуль для дисплея LCD расниновка

Перейти донизу

Модуль для дисплея LCD расниновка Empty Модуль для дисплея LCD расниновка

Повідомлення автор Admin Чт Лист 22, 2018 4:48 pm

https://www.14core.com/wiring-i2c-module-on-16x2-lcd-with-sclsda/


In this illustration we will going to wire the I2C or 2 wire connection in our Aruduino Board with the 16×2 Liquid Crystal Display, you can also use the 20×4 LCD, but on this demonstration we will going to wire the 16×2 LCD.

On this I2C module you can control an LCD with ease using 2 wires connected to your Arduino board via input SDA and the SCL see the illustration below to find the correct pin where you can connect your I2C module.

Diagram of I2C Module

At the left side of the module we have 4 pins, and two are voltage and ground, and the other two are the I2c (SDA/ and SCL). The board has a tripper pot to adjust the contrast of the LCD, and the jumper located at the opposite side allows the back-light controlled by the program or remain off.

I2C-LCD-Module-Board-Arduino-AVR-PIC

I2C Address

By default the module is configured with the address 0x27, but you can change this using the address pins A0, A1 and A2 located at I2C module board, see the table below.

I2C-LCD-Module-Board-Arduino-AVR-PIC2

Wiring I2C Module to Arduino UNO R3 Board

I2C-LCD-Module-Board-Arduino-AVR-PIC22

Wiring I2C Module to Arduino MEGA2560 Board

I2C-LCD-Module-Board-Arduino-Mega-2560

The I2C module has 16 pins that can be directly connected to the display, or you can test the connection in the breadboard, if your using MEGA2560 use the pin 20(SDA) and 21 for (SCL)

To control the I2C module you need to include the LiquidCrystal_i2C library, can be download here or download it below. Unzip the zip file and rename the folder to LiquidCrystal to LiquidCrystall2C, copying it to the folder libraries into the Arduino IDE. Rename the folder to avoid conflicts with LiquidCrystal libraries that is already built into the Arduino IDE.

The commands to work with the display control are almost similar to the LiquidCrystal library we use normally with commands such as lcd.begin(), lcd.print() and lcd.setCursor(). The commandlcd.setBacklight() allows you to adjust or activate the backlight of the LCD.
/*
14CORE LCD 16x2 Display Driving Example
*/
#include <Wire.h> // Include Wire.h to control I2C
#include <LiquidCrystal_I2C.h> //Download & include the code library can be downloaded below


LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3, POSITIVE); // Initialize LCD Display at address 0x27
void setup()
{
lcd.begin (16,2);
}

void loop()
{
 lcd.setBacklight(HIGH); //Set Back light turn On
 lcd.setCursor(0,0); // Move cursor to 0
 lcd.print("We are 14Core");
 lcd.setCursor(0,1);
 lcd.print("Ideas Comes Reality");
 delay(1000);
 lcd.setBacklight(LOW); // Set backlight to off
 delay(1000);
}

Admin
Admin

Кількість повідомлень : 2
Дата реєстрації : 22.11.2018

https://arduino.ukraine7.com

Повернутися до початку Перейти донизу

Повернутися до початку


 
Права доступу до цього форуму
Ви не можете відповідати на теми у цьому форумі