我想在16X02液晶屏上显示一些字符串。目前,我正在实现以下链接中给出的示例。我的16X02LCD的背光灯亮了,但是没有显示任何字符。我现在该怎么做?
https://www.losant.com/blog/how-to-connect-lcd-esp8266-nodemcu
#include <LiquidCrystal_I2C.h>
// Construct an LCD object and pass it the
// I2C address, width (in characters) and
// height (in characters). Depending on the
// Actual device, the IC2 address may change.
LiquidCrystal_I2C lcd(0x27, 16, 2); // my lcd pin address is different from the example
void setup() {
// The begin call takes the width and height. This
// Should match the number provided to the constructor.
Serial.begin(115200);
Serial.println ("In Setup");
lcd.begin(16,2);
lcd.init();
// Turn on the backlight.
lcd.backlight();
// Move the cursor characters to the right and
// zero characters down (line 1).
lcd.setCursor(5, 0);
// Print HELLO to the screen, starting at 5,0.
lcd.print("HELLO");
// Move the cursor to the next line and print
// WORLD.
lcd.setCursor(5, 1);
lcd.print("WORLD");
}
void loop() {
}发布于 2019-06-13 15:16:53
我假设你已经验证了你的物理连接并且提供了合适的电压供应。
您是否使用与GPIO扩展模块PCF8574相同的I2C。如果没有,您可能需要修改LCD模块。
还可以通过调整pot来验证您是否设置了正确的对比度电压。您应该首先将其设置为可以看到所有背景点(像素)的值;一旦文本可见,您可以将其设置为最佳值。
https://stackoverflow.com/questions/56358635
复制相似问题