[求助]这块显示器怎么用
2015-07-252.1万
AI 快速预览详细
本文介绍了如何使用Arduino IIC/I2C 2004液晶模块。首先,用户需要下载并安装LiquidCrystal_I2C2004V1库文件。接着,文章提供了详细的连接和调试步骤,帮助用户解决连接后没有反应的问题。通过这些步骤,用户可以快速解决显示问题,确保项目顺利进行。
|
Arduino IIC/I2C 2004 液晶模块 这块显示器是我在以下链接的店里头买的,但是不懂怎么用,求助= =(店主说他不懂。。) https://item.taobao.com/item.htm?spm=a1z09.2.9.19.unhXOO&id=13876958118&_u=p1qoj532ba04 ![]() ![]() 这里是库文件: LiquidCrystal_I2C2004V1.rar |

![[求助]这块显示器怎么用图1](https://imagemc.dfrobot.com.cn/data/attachment/forum/201507/25/211141cuj0434y5pwj3p6w.jpg?imageView2/2/format/webp/q/80)
![[求助]这块显示器怎么用图2](https://imagemc.dfrobot.com.cn/data/attachment/forum/201507/25/211145nn066osz1ruh84sq.jpg?imageView2/2/format/webp/q/80)




http://wiki.geek-workshop.com/doku.php?id=arduino:libraries:liquidcrystal
然后看2004的实例代码时就会容易一点
#include
#if defined(ARDUINO) && ARDUINO >= 100
#define printByte(args) write(args);
#else
#define printByte(args) print(args,BYTE);
#endif
LiquidCrystal_I2C lcd(0x20,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display
void setup(){
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.home();
lcd.print("Hello world...");
lcd.setCursor(0, 1);
lcd.print("dfrobot.com");
}
int backlightState = LOW;
long previousMillis = 0;
long interval = 1000;
void loop(){
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
previousMillis = currentMillis;
if (backlightState == LOW)
backlightState = HIGH;
else
backlightState = LOW;
if(backlightState == HIGH) lcd.backlight();
else lcd.noBacklight();
}
}