16X02不显示任何字符

时间:2019-05-29 10:40:03

标签: i2c arduino-ide nodemcu

我想在16X02 LCD上显示一些字符串。目前,我正在实现以下链接中给出的示例。我的16X02 LCD的背光灯亮着,但是没有显示任何字符。我现在该怎么办?

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() {
}

1 个答案:

答案 0 :(得分:0)

我假设您已通过物理连接验证并提供适当的电压。

您是否使用相同的I2C转GPIO扩展模块PCF8574。如果不是,则可能需要修改LCD模块。

还要通过调节电位计来验证是否设置了正确的对比度电压。首先应将其设置为value,以便可以看到所有背景点(像素);文本可见后,您可以将其设置为最佳值。