用户工具

站点工具


ocrobot:modules:iic_spi_1602

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
ocrobot:modules:iic_spi_1602 [2017/10/04 08:13] 弘毅ocrobot:modules:iic_spi_1602 [2023/06/07 04:23] (当前版本) – 外部编辑 127.0.0.1
行 1: 行 1:
 +====== I2C/SPI 1602液晶显示屏 ======
  
 +
 +===== 介绍 =====
 +**OCROBOT I2C/SPI 1602液晶显示屏**具有链接简单,实用方便等优点,充分利用总线优势,节约单片机IO,减少出错概率
 +
 +===== 参数 =====
 +显示内容:英文字符 标点  数字
 +
 +显示范围 16字*2
 +
 +供电电压:5v
 +
 +电平信号要求 3.3-5v
 +
 +=====图片=====
 +{{:ocrobot:modules:i2c总线1602液晶显示屏侧面-修改-435.png?nolink|}}
 +{{:ocrobot:modules:i2c总线1602液晶显示屏正面-修改-435.png?nolink|}}
 +{{:ocrobot:modules:i2c总线1602液晶显示屏亮-修改-435.png?nolink|}}
 +{{:ocrobot:modules:i2c总线1602液晶显示屏-背面-修改-435.png?nolink|}}
 +=====相关介绍=====
 +驱动库下载地址:{{:ocrobot:modules:1602:liquidcrystal.zip|点击下载}}
 +
 +
 +下载文件后,请解压缩到arduino根目录/libraries
 +
 +需要替换原有的liquidcrystal库目录
 +===== 示例代码 =====
 +
 +<code CPP>
 +//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);
 +}
 +</code>
 +
 +其他例程请自行参阅库中的各种例子