本帖最后由 快乐生活 于 2015-7-27 15:28 编辑
蓝屏屏1602用 IIC/I2C接口LCD1602转接板 控制
[pre lang="arduino" line="1" file="XIANSHI"]//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
delay(3000);
lcd.print("Hello, world!");
delay(3000);
}
void loop()
{
lcd.noBacklight();
delay(3000);
lcd.backlight();
delay(3000);
setup();
}[/code]
程序应该在初始化后显示"Hello, world!",延时3秒关背光灯,颜色3秒开背光灯。
但是使用时发现开背光灯后一会,字消失,一会又显示。
请问是什么原因造成的?
|