显示屏1602用IIC/I2C接口LCD1602转接板控制,在亮屏是现象内容有时候不显示?
本帖最后由 快乐生活 于 2015-7-27 15:28 编辑蓝屏屏1602用 IIC/I2C接口LCD1602转接板 控制
//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();
}
程序应该在初始化后显示"Hello, world!",延时3秒关背光灯,颜色3秒开背光灯。
但是使用时发现开背光灯后一会,字消失,一会又显示。
请问是什么原因造成的?
http://v.youku.com/v_show/id_XMTI5NDY4OTgwMA==.html loop()里面怎么会有setup()?
每次都重新初始化,所以没字了。 谢谢,删掉后显示正常。
页:
[1]