LCD and Serial problem

I'm having a problem with displaying stuff both on the LCD and the serial. Whenever i put Serial.begin(9600);
The LCD displays random stuff.
Any help?

We will need more information before making any suggestions.

How does the use of Serial.begin relate to your LCD display. Since you mention that the display displays 'random stuff' whenever you use Serial.begin that implies that it displays correct information whenever you don't.

So:

  • What type of interface are you using between your LCD and your Arduino?

  • What are you attempting to do with the serial interface?

  • Is the 'random stuff' truly random or is it the same every time?

Don

Is your LCD hooked up to pins 0 and 1 by any chance?

INTP:
Is your LCD hooked up to pins 0 and 1 by any chance?

Yes it is. 0, 1, 2 ,3 i use them for the data pins. (I cant use any others in my project cause they are all occupied).

Well 0 and 1 are used for serial data, so, you need to switch some pins around. Generally avoid using pins 0 and 1, but since you need all of your pins for whatever reason and we have no idea what they are, maybe there are some that won't be affected by the serial data.

bdrangova:
Yes it is. 0, 1, 2 ,3 i use them for the data pins. (I cant use any others in my project cause they are all occupied).

Swap the pins around, just don't put the LCD "Enable" line on pins 0 or 1, that is the signal that tells the LCD to accept or provide data.