arduino连接1602电路及驱动程序

#include <LiquidCrystal.h>
//以对应GPIO引脚的编号初始化LCD库
LiquidCrystal lcd( 7, 6, 5, 4, 3, 2);
void setup() {
  //设置LCD的列数和行数
  lcd.begin(16, 2);
  //在LCD上输出一串字符,如果不设置起始坐标,LCD默认从第一行第一列开始显示
  lcd.print("hello, world!");
}
void loop() {
  // 设置起始坐标为第一列,第二行
  // (提示:列数和行数的编号都是从0起始):
lcd.setCursor(0, 1); 
//在第一列,第二行显示从系统复位到现在经过的秒数
lcd.print(millis() / 1000);
}
转载自: https://www.arduino.cn/thread-20674-1-1.html

猜你喜欢

转载自blog.csdn.net/lingdongtianxia/article/details/79956145