Pages: [1]   Go Down
Author Topic: [SOLVED]LCD Display doesn't work if Serial.begin() is executed  (Read 1099 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello I just tested my new LCD display and it works fine.

The setup I'm using is this:
http://arduino.cc/en/Tutorial/LiquidCrystal

When I run the following code everything works as intended:
Code:
void setup()
{
  lcd.begin(16,2);
  lcd.print("Hello World");
}

But if I add Serial.begin(9600); liked this, the display shows weird symbols and doesn't update anymore, why is that?

Code:
void setup()
{
  Serial.begin(9600);
  lcd.begin(16,2);
  lcd.print("Hello World");
}
« Last Edit: July 19, 2012, 01:22:14 pm by AWOL » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26495
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where is the rest of your code?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where is the rest of your code?

That is the code, just made a simple example to point out my problem.

Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That doesn't compile.
Quote
sketch_jul19a.cpp: In function 'void setup()':
sketch_jul19a:3: error: 'lcd' was not declared in this scope

Where is your lcd declaration?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(6,5,4,3,2,1);

void setup()
{       
  //Serial.begin(9600);
  lcd.begin(16,2);
  lcd.print("HELLO WORLD!");
}

void loop()
{
 
}

That is the whole code it works fine as long as Serial.begin(9600) is out commented. But if I uncomment Serial.Begin it shows the odd symbols on the display.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26495
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
lcd(6,5,4,3,2,1);
1?

Wouldn't it have wasted a lot less time if you'd posted that at the start?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not sure what you mean about 1?

What is the sulotion?

Sorry if I'm asking a stupid question.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26495
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which pins does the serial interface use?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pins 0 and 1 belong to the hardware serial port. When you do Serial.begin(), it starts using the pins.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I plugged it into
6,5,4,3,2,1
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26495
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, and that's your problem, so move the pin that is connected to pin 1 on the Arduino.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, thanks a lot smiley
Logged

Pages: [1]   Go Up
Jump to: