I get extra character (frowning face) when sending a text over the serial monitor(see attached image)
When empty string is sent over the serial monitor, the LCD display still shows the extra character of frowning face.
How do I get rid of the extra character?
I use the tutorial code below and change nothing in the code. https://www.arduino.cc/en/Tutorial/LibraryExamples/LiquidCrystalSerialDisplay/
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// initialize the serial communications:
Serial.begin(9600);
}
void loop() {
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}