Introduction
Referring to the LCD16020, I believe that everyone is not unfamiliar the square shape, green color, a row of 2.54 pin header.... LCD1602 module is a product of the DFRobot Gravity IIC series, which has been greatly optimized for its original LCD1602 appearance. This module does not need to adjust the contrast, retain the backlight controllable function, simultaneously compatible with 3.3V and 5V voltage. The optimization of function and the appearance brings you the different experience. This kind of module has the blue screen, the green screen, the gray screen.
Specification
- Operating Voltage: 3.3V~5.0V
- Operating Current: ≤20mA
- Display Description: 16*2
- Communication Mode: IIC/I2C
- Backlight: Blue/Green/Gray
- Operating Temperature: -20 to +70°C
- Storage Temperature: -30 to +80°C
- Dimension: 87.0*32.0*13.0mm/3.43*1.26*0.51in
Board Overview
Num | Label | Description |
---|---|---|
1 | VCC | 3.3~5V |
2 | GND | GND |
3 | SCL | IIC_Clock |
4 | SDA | IIC_Data |
Tutorial
Follow the pin description to connect the hardware, then download the sample code to UNO. After upload finished, you can see the LCD display and backlight gradient effect.
Requirements
Hardware
- DFRduino UNO R3 (or similar) x 1
- Gravity: I2C LCD1602 Arduino LCD Display Module.
- M-M/F-M/F-F Jumper wires
Software
- Arduino IDE, Click to Download Arduino IDE from Arduino®
Connection Diagram
Sample Code
Download DFRobot LCD Library How to install Libraries in Arduino IDE
/*!
* file Fade.ino
* brief Fade.
*
* Copyright [DFRobot](https://www.dfrobot.com), 2016
* Copyright GNU Lesser General Public License
*
* version V1.0
* date 2018-1-13
*/
#include "DFRobot_RGBLCD1602.h"
/*
Change the RGBaddr value based on the hardware version
-----------------------------------------
Moudule | Version| RGBAddr|
-----------------------------------------
LCD1602 Module | V1.0 | 0x60 |
-----------------------------------------
LCD1602 Module | V1.1 | 0x6B |
-----------------------------------------
LCD1602 RGB Module | V1.0 | 0x60 |
-----------------------------------------
*/
DFRobot_RGBLCD1602 lcd(/*RGBAddr*/0x6B ,/*lcdCols*/16,/*lcdRows*/2); //16 characters and 2 lines of show
void breath(unsigned char color){
for(int i=0; i<255; i++){
lcd.setPWM(color, i); // 调节背光亮度,0为关闭
delay(5);
}
delay(500);
for(int i=254; i>=0; i--){
lcd.setPWM(color, i);
delay(5);
}
delay(500);
}
void setup() {
// initialize
lcd.init();
// Print a message to the LCD.
lcd.setCursor(4, 0);
lcd.print("DFRobot");
lcd.setCursor(1, 1);
lcd.print("lcd1602 module");
}
void loop() {
breath(lcd.REG_ONLY);
}
Expected Results
- In the first row, the fifth pane of the screen shows "DFRobot"
- The second row, the second pane of screen shows "lcd1602 module"
- The screen backlight shows the breathing state while the caption is displayed
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum. |
---|