参数名称 | 参数 |
工作电压 | 3.3V/5V |
工作电流 | 5V:26mA |
3.3V:13mA | |
通信接口 | I2C |
I2C地址 | LCD:0x7C |
LED:0x6B | |
屏幕类型 | 液晶屏 |
控制芯片 | LCD:AiP31068L |
LED:SN3193 | |
产品尺寸 | 87.0 x 32.0 x 13.0 mm |
功能引脚 | 描述 |
VCC | 3.3V/5V 电源正 |
GND | 电源地 |
SCL | I2C时钟线 |
SDA | I2C数据线 |
sudo raspi-config nonint do_i2c 0
连接树莓派的时候,选择用4PIN排线连接,请参考下方的引脚对应表格
使用的是排针或者PH2.0 4PIN接口,需要对照以下表格连线
LCD | Raspberry Pi | |
BCM2835编码 | Board物理引脚序号 | |
VCC | 3.3V | 3.3V |
GND | GND | GND |
SCL | SCL.1 | 5 |
SDA | SDA.1 | 3 |
以LCD1602 Module使用的是PH2.0 4PIN接口为例,对照上述表格连接在树莓派上即可: (请按照引脚定义表格连接,图中排线颜色仅供参考,以实际颜色为准。)
【安装库并下载程序】
cd ~ git clone https://github.com/WiringPi/WiringPi.git cd WiringPi/ ./build debian mv debian-template/wiringpi-3.0-1.deb . sudo apt install ./wiringpi_3.10_arm64.deb
cd ~ wget https://www.waveshare.net/w/upload/3/3c/Lg-master.zip unzip Lg-master.zip cd lg-master make sudo make install
cd ~ wget https://files.waveshare.net/wiki/LCD1602%20I2C%20Module/LCD1602_I2C_Module_Demo.zip unzip LCD1602_I2C_Module_Demo.zip cd ~/LCD1602_I2C_Module_code/Raspberry/c sudo make
【运行 Character display 示例】
cd ~/LCD1602_I2C_Module_code/Raspberry/c sudo ./main 1
【运行 Custom char 示例】
cd ~/LCD1602_I2C_Module_code/Raspberry/c sudo ./main 2
【运行 Direction control 示例】
cd ~/LCD1602_I2C_Module_code/Raspberry/c sudo ./main 3
【运行 Display time 示例】
cd ~/LCD1602_I2C_Module_code/Raspberry/c sudo ./main 4
【运行 Scroll display 示例】
cd ~/LCD1602_I2C_Module_code/Raspberry/c sudo ./main 5
【makefile脚本说明】
我们做了两个库的使用,Wiringpi跟Lgpio,开发者可以从Makefile中,选择任意一个即可
USELIB = USE_WIRINGPI_LIB # USELIB = USE_DEV_LIB
可以通过注释/取消注释这些行,切换使用不同的库
【安装库并下载程序】
sudo apt install python3-smbus
cd ~ wget https://files.waveshare.net/wiki/LCD1602%20I2C%20Module/LCD1602_I2C_Module_Demo.zip unzip LCD1602_I2C_Module_Demo.zip cd ~/LCD1602_I2C_Module_code/Raspberry/python/examples
【运行 Character display 示例】
sudo python Character_display.py
【运行 Custom char 示例】
sudo python Custom_char.py
【运行 Direction control 示例】
sudo python Direction_control.py
【运行 Display time 示例】
sudo python Display_time.py
【运行 Scroll display 示例】
sudo python Scroll_display.py
模块接口 | Pico 功能引脚 |
VCC | 3.3V |
GND | GND |
SCL | GP5 |
SDA | GP4 |
实物连接图如下
【主函数说明】
【程序烧录】
【烧录Micropython固件】
【保存驱动库】
【运行示例】
【安装库】
【运行示例】
模块接口 | Arduino 功能引脚 |
VCC | 5V/3.3V |
GND | GND |
SCL | SCL |
SDA | SDA |
实物连接图
【安装库】
【运行示例】
连接ESP32的时候,选择用4PIN排线连接,请参考下方的引脚对应表格
使用的是排针或者PH2.0 4PIN接口,需要对照以下表格连线
LCD | ESP32 | |
引脚编号 | ||
VCC | 5V/3.3V | |
GND | GND | |
SCL | GPIO5 | |
SDA | GPIO4 |
以LCD1602 Module使用的是PH2.0 4PIN接口为例,对照上述表格连接在ESP32上即可: (请按照引脚定义表格连接,图中排线颜色仅供参考,以实际颜色为准。)
接入ESP32 如下图。
【安装库】
【运行示例】
【烧录Micropython固件】
*\LCD1602_I2C_Module_Demo\esp32\python\bin
【保存驱动库】
【运行示例】
连接Jetson nano的时候,选择用4PIN排线连接,请参考下方的引脚对应表格
使用的是排针或者PH2.0 4PIN接口,需要对照以下表格连线
LCD | Jetson nano | |
Board物理引脚序号 | ||
VCC | 3.3V | |
GND | GND | |
SCL | 5 | |
SDA | 3 |
以LCD1602 Module使用的是PH2.0 4PIN接口为例,对照上述表格连接在Jetson nano上即可: (请按照引脚定义表格连接,图中排线颜色仅供参考,以实际颜色为准。)
接入Jetson nano 如下图。
【安装库并下载程序】
sudo apt install python3-smbus
sudo apt install python-smbus
cd ~ wget https://files.waveshare.net/wiki/LCD1602%20I2C%20Module/LCD1602_I2C_Module_Demo.zip unzip LCD1602_I2C_Module_Demo.zip cd ~/LCD1602_I2C_Module_code/Jetson Nano/python/examples
【运行 Character display 示例】
sudo python Character_display.py
【运行 Custom char 示例】
sudo python Custom_char.py
【运行 Direction control 示例】
sudo python Direction_control.py
【运行 Display time 示例】
sudo python Display_time.py
【运行 Scroll display 示例】
sudo python Scroll_display.py
【C/C++】
API介绍
/** * @brief 液晶屏初始化 * @param cols 列数量(暂时无功能) * @param rows 行数量 */ void LCD1602_init(uint8_t cols, uint8_t rows);
/** * @brief 打开显示 */ void LCD1602_display();
/** * @brief send command * @param value 发送的命令 */ void LCD1602_command(uint8_t value);
/** * @brief 设置光标位置 * @param col 列数 可选范围 0-15 最大为39,需要移动才能观察到大于15的字符 * @param row 行数 可选范围 0-1,0代表了第一行,1代表了第二行 */ void LCD1602_setCursor(uint8_t col, uint8_t row);
/** * @brief 清除显示并将光标回到初始位置(0位置) */ void LCD1602_clear();
/** * @brief 写入数据 * @param value 写入的数据 */ void LCD1602_data(uint8_t value);
/** * @brief 显示字符串 * @param str 显示的字符串 */ void LCD1602_send_string(const char *str);
/** * @brief 关闭下划线光标 */ void LCD1602_noCursor();
/** * @brief 打开下划线光标 */ void LCD1602_cursor();
/** * @brief 向左滚动显示 */ void LCD1602_scrollDisplayLeft();
/** * @brief 向右滚动显示 */ void LCD1602_scrollDisplayRight();
/** * @brief 此函数用于从左到右流动的文本 */ void LCD1602_leftToRight();
/** * @brief 此函数用于从右到左流动的文本 */ void LCD1602_rightToLeft();
/** * @brief 这将使文本从显示光标处“左对齐” */ void LCD1602_noAutoscroll();
/** * @brief 这将使文本从显示光标处“右对齐” */ void LCD1602_autoscroll();
/** * @brief 允许我们将前8个CGRAM位置填充自定义字符 * @param location 代替字符 范围(0-7) * @param charmap 字符数组 大小8个字节 */ void LCD1602_createChar(uint8_t location, uint8_t charmap[]);
/** * @brief 背光芯片初始化 */ void LCD1602_led_init();
/** * @brief 设置背光亮度 * @param value 背光强度值 范围(0-100) */ void LCD1602_set_brightness(uint8_t value);
/** * @brief 设置背光模式 * @param mode 0x00为正常模式,0x20为呼吸模式 */ void LCD1602_set_led_mode(uint8_t mode);
【Python】
API介绍
def command(self, cmd) @brief send command @param cmd 发送的命令
def data(self,data) @brief write character @param data 写入的数据
def setCursor(self,col,row) @brief 设置光标位置 @param col 列数 可选范围 0-39 @param row 行数 可选范围 0-1,0代表了第一行,1代表了第二行
def clear(self) @brief 清除显示并将光标回到初始位置(0位置)
def printout(self,arg) @brief 向液晶屏输出显示 @param arg 输出的数据
def createChar(self, location, charmap) @brief 允许我们将前8个CGRAM位置填充自定义字符 @param location 代替字符 范围(0-7) @param charmap 字符列表 大小8个字节
def scrollDisplayLeft(self) @brief 向左滚动显示
def scrollDisplayRight(self) @brief 向右滚动显示
def cursor(self) @brief 打开下划线光标
def nocursor(self) @brief 关闭下划线光标
def leftToRight(self) @brief 此函数用于从左到右流动的文本
def rightToLeft(self) @brief 此函数用于从右到左流动的文本
def autoscroll(self) @brief 这将使文本从显示光标处“右对齐”
def noautoscroll(self) @brief 这将使文本从显示光标处“左对齐”
def display(self) @brief 打开显示
def set_brightness(self, Value) @brief 设置背光亮度 @param Value 范围(0-100)
def set_mode(self, Mode) @brief 背光模式 @param Mode 正常模式(0x00),呼吸模式(0x20)
可能是python固件不兼容的问题,可以使用我们示例程序给出的固件版本。
有的。
一般在30mA左右。
周一-周五(9:30-6:30)周六(9:30-5:30)
手机:13434470212
邮箱:services04@spotpear.cn
QQ:202004841