Offline
Newbie
Karma: 0
Posts: 16
|
 |
« on: July 19, 2012, 07:58:28 am » |
Hello I just tested my new LCD display and it works fine. The setup I'm using is this: http://arduino.cc/en/Tutorial/LiquidCrystalWhen I run the following code everything works as intended: 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? 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
Brattain Member
Karma: 137
Posts: 19052
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: July 19, 2012, 08:31:35 am » |
Where is the rest of your code?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #2 on: July 19, 2012, 10:55:53 am » |
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
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #3 on: July 19, 2012, 11:12:40 am » |
That doesn't compile. 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
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #4 on: July 19, 2012, 01:01:56 pm » |
#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
Brattain Member
Karma: 137
Posts: 19052
I don't think you connected the grounds, Dave.
|
 |
« Reply #5 on: July 19, 2012, 01:13:27 pm » |
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.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #6 on: July 19, 2012, 02:26:44 pm » |
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
Brattain Member
Karma: 137
Posts: 19052
I don't think you connected the grounds, Dave.
|
 |
« Reply #7 on: July 19, 2012, 02:29:10 pm » |
Which pins does the serial interface use?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #8 on: July 19, 2012, 02:30:08 pm » |
Pins 0 and 1 belong to the hardware serial port. When you do Serial.begin(), it starts using the pins.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #9 on: July 19, 2012, 02:33:06 pm » |
I plugged it into 6,5,4,3,2,1
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19052
I don't think you connected the grounds, Dave.
|
 |
« Reply #10 on: July 19, 2012, 02:34:20 pm » |
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.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #11 on: July 19, 2012, 02:48:59 pm » |
Ok, thanks a lot 
|
|
|
|
|
Logged
|
|
|
|
|
|