16x1 LCD issue

Hi all,

today my lcd finnaly arrived and after I hooked it to adruino (2009) using the Hello World! example only Hello W is displayed after some searching I found out about the register diff and knowing that I used this code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup() {
  lcd.begin(8, 2);
  lcd.print("ROFLCOPT");
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print("ER!!!!!!!");
}

and this works but if u put it like this:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup() {
  lcd.begin(8, 2);
  lcd.print("ROFLCOPTER!!!!!!!");
}

void loop() {}

only ROFLCOPT gets displayed even though there only 8 charecters a row defined is there anyway to fix this “issue”?

Err0rC0deX

You are telling your arduino that the LCD has 2 rows of 8 characters... I would expect the result you are getting. That's what LCD.begin does.

Try changing to " lcd.begin(16, 1); " and see if it helps.

I just tried some different things
and when I use this code at start up ROFLCOPT is displayed and after a second ROFLCOPTER!!! as it should be

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup() {
  lcd.begin(8, 2);

void loop() {
  lcd.print("ROFLCOPTER!!!!!!!");
delay(1000);
}

dono why this works but I tried printing sane 16 cha after eachother in loop but that did’t work

will try some more tommorow first I need some sleep

Err0rC0deX

16 ,1 only 8 first cha are used 16 ,2 is kidda chaos

8 ,1 only first 8 cha are used and each loop is shifts 4 characters 1=ROFLCOPT 2=COPTER12 etc 8 ,2 is as in first post

will try more things tomorow

Err0rC0deX

Try 8,4.

For some strange reason when using an 8x4 the first line wraps to the 3rd. So i think whats happening is when using an 8x2 it only thinks there are 8 characters to be able to be written to and so only writes 8 characters out to the LCD.

(8 ,4)

code:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup() {
  lcd.begin(8, 4);
}

void loop() {
  lcd.print("ROFLCOPTER!!!!!!");
  delay(5000);
}

on start it will display ROFLCOPT after 5 seconds its ROFLCOPTER!!!
if i try lcd.print(“ROFLCOPTER0123456789”);
result is: ROFLCOPT after 5 seconds its ROFLCOPTROFLCOPT

at this point only doing what I did in first post seems to work

Have you checked if Arduino is correctly connected to the screen? I had a similar issue when one of the LCD pins wasn't connected to Arduino.

pins are connected correctly the display also works but only prob atm is software cause there is a register difference for first and second row of 8 characters

what I want to achieve is some kidda split to split a string longer then 8 cha into 2 parts displayed on the 2 rows this is done automaticly by lcd library with 16x2 lcds but not with the 16x1 or it doesn't work

Err0rC0deX

Maybe something like this:

void printLong(String dat) {
  if (dat.length() > 8){
  int a;
  String temp;
    for (a=0;a!=7;a=a+1) {
    temp=temp+dat.charAt(a);
    }
  lcd.print(temp);
  temp="";
    for (a=8;a!=dat.length()-1;a=a+1) {
    temp=temp+dat.charAt(a);
    }
  lcd.print(temp); 
  }
}

I didn't checked if it is correct. Treat this as an idea ;)

Treat this as an idea

The String object has a substring method that does all the hard work…

You are telling your arduino that the LCD has 2 rows of 8 characters... I would expect the result you are getting. That's what LCD.begin does.

Try changing to " lcd.begin(16, 1); " and see if it helps.

WRONG - his and most other 16x1 LCDs are actually set up as 8x2. You must set the cursor to the beginning of line 0 and send the first eight characters, then set the cursor to the beginning of line 1 and send the next eight characters. See the link referenced below for the explanation.

Try 8,4.

This won't help anything. The past and current versions of LiquidCrystal only check the second argument and they only check to see if it is '1' or anything other than '1'.

For some strange reason when using an 8x4 the first line wraps to the 3rd.

It's not strange, it's normal. For the explanation follow the [u]LCD Addressing[/u] link at http://web.alfredstate.edu/weimandn.

Don

thx for that link http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html

as you said it has 2 rows of 8 characters long now I know why those other characters are not displayed or disappear

but what would be best way to get things done adjust the library or use a code to split string into 8 cha long strings and then write them to display?

but what would be best way to get things done adjust the library ...

Search for LiquidCrystal440 (use the box at the top right) and see if that library does what you want. The library is specifically written to deal with 40x4 displays but I thing John did some work on line wrapping for all of the displays as well.

Don

today tested the 440 library with this code:

#include <LiquidCrystal440.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup() {
  lcd.begin(8, 2);
   lcd.print("ROFLCOPTER!!!!!!");
}

void loop() {
}

and it works !! ;D

if I write more then 16 characters all characters above 16 are written over the first on screen so
ROFLCOPTER012345678 displayas 678LCOPTER012345

but anyway its awesome

thx Don

Err0rC0deX:

thx for that link http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html...

For the future - this is NOT the link that I specified and you are not doing future readers of this thread any favors by posting this shortcut. I posted it as "follow the [u]LCD Addressing[/u] link at http://web.alfredstate.edu/weimandn" and here's the first sentence at that location:

"Since I'm really not sure how this website is ultimately going to be structured it would be a good idea to link only to this index page.   There is a good possibility that the location of some of the reference material will be moved as the website develops."

Also - when you do post a link you should check it out. Your version was improperly tagged and it doesn't work.

Don