ACM1602B-FL-YBW 几秒后关闭

ACM1602B-FL-YBW turns off after a few seconds

我正在尝试使用 Arduino Uno、三个按钮和一个 ACM1602B-FL-YBW 显示器制作剪刀石头布游戏。

我只是用这个显示器做一个简单的 "Hello World" 就遇到了问题。

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12,11,10,7,6,5,4);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis() / 1000);
}

看视频,这段代码应该在显示屏的第一行打印 "Hello World" 和上次 Arduino 重置后经过的秒数,我应该看到计数器每秒都在进行。

但我只看到 "Hello World" 和一个数字,一秒钟后什么也没有显示。

每次重置时,我都会再次看到 "Hello world" 以及自上次重置以来经过的秒数,然后再次关闭。

我发现了问题,对比度太高无法让显示器通过 USB 线供电,所以我只是将对比度引脚连接到 GND。之后就没问题了。