用Arduino Nano连接IIC LCD显示器模块上循环显示“Hennan University of Technology”字样。并可适当改变显示样式和速度
学会使用LCD显示屏,静态显示或则滚动显示,并可以调整速度
原理图:
流程图:
代码加粗样式
#include <Wire.h> // Arduino IDE 內建
#include <LiquidCrystal_I2C.h>
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 設定 LCD I2C 位址
void setup() {
lcd.begin(16, 2); // 初始化 LCD,一行 16 的字元,共 2 行,预设开启背光
// 闪灯三次
for(int i = 0; i < 3; i++) {
lcd.backlight(); // 开启背光
delay(250);
lcd.noBacklight(); // 关闭背光
delay
Arduino——LCD显示实验
最新推荐文章于 2025-02-11 23:34:38 发布