Extra characters when using lcd.print
Posted: Mon Jul 25, 2016 12:28 pm
At startup I have some values written to an lcd connected to the ESP8266 via I2C. I print the WiFi.hostname() on the first line, a second counter (in loop()) on the second half of the first line. I print "IP:", and then the ip address on the second line. On the third line I wrote the ip address in HEX. (the order is reversed for some reason). On the fourth line I print ESP.getFlashChipRealSize().
With the counter and the "IP:" write I get exactly what I expect. But when I have the rest of the information printed(with function calls) I end up with a couple of extra characters at the end. When I use Serial.print() these characters do not appear on the serial terminal. (as expected)
What is going on here? I would think that how I performed the operation is valid.
With the counter and the "IP:" write I get exactly what I expect. But when I have the rest of the information printed(with function calls) I end up with a couple of extra characters at the end. When I use Serial.print() these characters do not appear on the serial terminal. (as expected)
What is going on here? I would think that how I performed the operation is valid.
Code: Select all
lcd.setCursor(0, 1);
lcd.print("IP: ");
lcd.setCursor(3, 1);
lcd.println(WiFi.localIP());
lcd.setCursor(0, 0);
lcd.println(WiFi.hostname());
Serial.println(WiFi.localIP(),HEX);
lcd.setCursor(0, 2);
lcd.println(WiFi.localIP(),HEX);
lcd.setCursor(0, 3);
lcd.println(ESP.getFlashChipRealSize());