LCD Problems

Hi There

I was wonder if someone can point me in the right direction, I playing around with a LCD display and "HelloWorld" and "SerialDisplay" are working perfectly

but when i try to add a start up message some of the charactors act a bit strange

here a link to a image of the display output (ps it always acts the same)

Here's my code

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 8, 7, 6, 5);

void setup(){
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// initialize the serial communications:
Serial.begin(9600);
}

void loop()
{
lcd.setCursor(0, 0);
lcd.print("*** Welcome! ***");
}

What happens if

  1. You just have it writing it once in the setup section ?

  2. You use a different/Shorter message ?

Hi Pluggy

I tried writing in the set up and the error is slightly different but still there

if i make the message short that 9 characters it is ok but the 9th characters does error no matter what the message i send

Cheers

James

lcd.setCursor(0, 0);
lcd.print("*** Welcome! ***");

This stuff doesn't belong in loop(), put it in setup().

Unfortunately this does not address your problem which is really strange since the three vertical lines are each 8 pixels high. Normally the lowest pixel is used only for the cursor and is not used for any of the characters, even those with descenders (g, q, etc.).

Try indenting your message and see if the problem shifts along with the indent. In other words is the problem with the ninth character or with the ninth position on the display.

Try putting the message on the second line.

Don

You should have a delay(xxx) in the loop, Arduino runs a 16Mhz and you are trying to update the LCD many many times each second, probably way faster than it can handle. But if the error is still there when you put the message in setup this is probably not the problem.

Try to load the hello world sketch again and verify that it still displays the text correctly, just to confirm that there is no hardware problems, and that you can display strings longer then 9 chars. without problems.

EDIT:

try

lcd.setCursor(0, 1);

in stead of

lcd.setCursor(0, 0);

Thanks for everyones replies

I think this has something to do with the serial if i remove "Serial.begin(9600);" from the original code it work perfectly. However I managed to get this working by breaking the message into three parts

here's my new code if any one interested

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 8, 7, 6, 5);

void setup(){
  // set up the LCD's number of rows and columns: 
  lcd.begin(16, 2);
  // initialize the serial communications:
  Serial.begin(9600);
  lcd.clear();
  delay(500);
  lcd.setCursor(0, 0);
  lcd.print(" ** Welc");
  lcd.setCursor(8, 0);
  lcd.print("ome! *");
  lcd.setCursor(14, 0);
  lcd.print("* ");
}

void loop()
{ 
  delay(1000);
}

Cheers

James

MikMo

You should have a delay(xxx) in the loop, Arduino runs a 16Mhz and you are trying to update the LCD many many times each second, probably way faster than it can handle.

There is no need to update the LCD any number of times per second, hour, day, or fortnight. That is why the code belongs in setup() and not in loop().

Don

jamesOB

Why don't you send the startup message (in one piece instead of three) first and then initialize the serial communications?

What is the purpose of the time delay in your loop()?

Don