Thank you for your replies!
Currently the connections between LCD and Arduino are as follows:
GND ->GND (via breadboard)
VCC -> +5V (via breadboard)
SDA -> A4 (directly)
SCL -> A5 (directly)
Connections are using standard jumperwires; I haven't soldered because this is not yet the final setup.
Next to that I have a Piezzo attached to D3.
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
int piezzoPin = 3;
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup(){
lcd.begin(16,2);
lcd.clear();
lcd.print("TEST");
}
void loop(){
//Check for serial input
if(Serial.available())
{
String incoming = Serial.readStringUntil('\n');
char header = incoming[0];
String message = incoming.substring(1);
lcd.clear();
lcd.print(message);
tone(piezzoPin,5000,100);
}
}
Basicly, usually the LCD initializes fine and displays 'TEST'. Then, when I start inputting string via serial, sometimes it works fine, and sometimes the LCD does not update at all (but the piezzobeep is heard, so the above code is running).
Next to that, a lot of time when I reupload the program, the LCD keeps displaying old information and does not update, where you would expect it to display 'TEST' again.
Also, sometimes when I power up the Arduino the LCD does not initialize (e.g. show a top row of boxes) until after a couple of resets and it will work fine again.
Anyway, the problems are intermittent, which leads me to believe the error is not in the code.
I will attach some photo's later today, didn't have a lot of time yet 