Go Down

Topic: [SOLVED]LCD Display doesn't work if Serial.begin() is executed (Read 1 time) previous topic - next topic

Artifactx

Jul 19, 2012, 02:58 pm Last Edit: Jul 19, 2012, 08:22 pm by AWOL Reason: 1
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: [Select]
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: [Select]
void setup()
{
 Serial.begin(9600);
 lcd.begin(16,2);
 lcd.print("Hello World");
}


AWOL

"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.

Artifactx


Where is the rest of your code?


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


dxw00d

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?

Artifactx

Code: [Select]
#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.

AWOL

Code: [Select]
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?
"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.

Artifactx

I am not sure what you mean about 1?

What is the sulotion?

Sorry if I'm asking a stupid question.

AWOL

"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.

dxw00d

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


AWOL

Yes, and that's your problem, so move the pin that is connected to pin 1 on the Arduino.
"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.


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy