Arduino | Display Text On LCD From Serial Monitor Input

preview_player
Показать описание
Buy me a coffe?
🇮🇩 Traktir saya?
Рекомендации по теме
Комментарии
Автор

the code you provided works fine
How can I expand to write on two lines ie write in serial monitor, press enter, and see text on lcd line 0 THEN write again in serial monitor and see text on lcd line 1
Thanks

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 20, 4);

void setup () {
Serial.begin (9600);
lcd.init ();
lcd.backlight ();
}

void loop () {
if (Serial.available ()) {
delay (100);
lcd.clear ();
lcd.setCursor (5, 0); // first line is 0 & 5 is 5 spaces from line start at 0
while (Serial.available() > 0) {
lcd.write (Serial.read () ) ;
}
}
}

lastchance