1
私は、Arduino Uno、3つのボタン、ACM1602B-FL-YBWディスプレイを使用して、岩、紙、はさみゲームを作ろうとしています。数秒後に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);
}
動画を見てみると、ディスプレイの最初の行と最後のArduinoから渡された秒数での「Hello World」を印刷する必要があり、このコードはリセットされ、私はカウンターが上と毎秒に行くはずです。
しかし、「Hello World」と数字だけが表示され、1秒後には何も表示されません。
リセットするたびに、「Hello world」と最後のリセット以降に経過した秒数が表示され、再びオフになります。