用户工具

站点工具


ocrobot:modules:iic_spi_1602

I2C/SPI 1602液晶显示屏

介绍

OCROBOT I2C/SPI 1602液晶显示屏具有链接简单,实用方便等优点,充分利用总线优势,节约单片机IO,减少出错概率

参数

显示内容:英文字符 标点 数字

显示范围 16字*2

供电电压:5v

电平信号要求 3.3-5v

图片

相关介绍

驱动库下载地址:点击下载

下载文件后,请解压缩到arduino根目录/libraries

需要替换原有的liquidcrystal库目录

示例代码

//DATA TO  A4
//CLK  TO  A5
#include "Wire.h"
#include "LiquidCrystal.h"
 
// Connect via i2c, default address #0 (A0-A2 not jumpered)
LiquidCrystal lcd(0);
 
void setup() {
  // set up the LCD's number of rows and columns: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}
 
void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
 
  lcd.setBacklight(HIGH);
  delay(500);
  lcd.setBacklight(LOW);
  delay(500);
}

其他例程请自行参阅库中的各种例子

ocrobot/modules/iic_spi_1602.txt · 最后更改: 2023/06/07 04:23 由 127.0.0.1