The new Raspberry Pi B Model B+ is here - Pick one up in the store and check our detailed guide!

4x20 LCD: Only 2 Lines Work

by DWW on Wed Jan 23, 2013 1:38 pm

Hello,

This is my first post and I'm quite new to Arduino. I've got a 4x20 RBG LCD and I've followed the LCD tutorial, but it only help me get 2 lines of my 4x20 LCD to work.

This is a guess, but I'm thinking that there must be something that requires changing in the LiquidCrystal.h library so that I can get all 4 lines to work?

If you have any suggestions, please let me know.


===
DancesWithWords
DWW
 
Posts: 3
Joined: Thu Nov 29, 2012 3:43 pm

Re: 4x20 LCD: Only 2 Lines Work

by adafruit_support_bill on Wed Jan 23, 2013 1:46 pm

In setup(), change lcd.begin(16, 2); to lcd.begin(20, 4);
Code: Select all | TOGGLE FULL SIZE
void setup() {
  // set up the LCD's number of rows and columns:
  lcd.begin(20, 4);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: 4x20 LCD: Only 2 Lines Work

by DWW on Wed Jan 23, 2013 2:49 pm

Tried your solution and received:

sketch_jan22a.cpp: In function ‘void setup()’:
sketch_jan22a.cpp:7:3: error: ‘lcd’ was not declared in this scope



===
DancesWithWords
DWW
 
Posts: 3
Joined: Thu Nov 29, 2012 3:43 pm

Re: 4x20 LCD: Only 2 Lines Work

by adafruit_support_bill on Thu Jan 24, 2013 5:20 am

What name did you use for your liquid crystal object?
If you declared
Code: Select all | TOGGLE FULL SIZE
LiquidCrystal xxxxx(12, 11, 5, 4, 3, 2);


Then you call
Code: Select all | TOGGLE FULL SIZE
xxxxx.begin(20, 4)


in your setup()
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: 4x20 LCD: Only 2 Lines Work

by DWW on Thu Jan 24, 2013 11:25 am

I got the LCD working with the following:

#include <LiquidCrystal.h>

/*
LiquidCrystal display with:
LCD 1 (0V) to arduino ground pin 14
LCD 2 (5V) to arduino +5 V
LCD 3 (V0) to output from potentiometer 10kOhm connected between +5 V and GND
LCD 4 (RS) to arduino pin 12
LCD 5 (R/W) to arduino ground
LCD 6 (E) to arduino pin 11
LCD 11 (DB4), 12 (DB5), 13 (DB6), 14 (DB7) on arduino pins 7, 8, 9, 10
LCD15 (LED+) through resistor 12 Ohm to arduino +5 V
LCD16 (LED-) to arduino ground
*/

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup()
{
lcd.begin(20, 4); //lcd.begin(columns, rows)
lcd.setCursor(2,0); // Position cursor on line x=3,y=1
lcd.print("4x20 LCD DISPLAY"); // Print a message to the LCD
lcd.setCursor(3,1);
lcd.print("with controller");
lcd.setCursor(7,2);
lcd.print("HD44780");
lcd.setCursor(1,3);
lcd.print("useful for Arduino");
}

void loop()
{
}



I was wondering how does one do a scrolling message?

===
DWW

PS. Really appreciate the prompt help.
DWW
 
Posts: 3
Joined: Thu Nov 29, 2012 3:43 pm

Re: 4x20 LCD: Only 2 Lines Work

by adafruit_support_bill on Thu Jan 24, 2013 2:04 pm

There is an "Autoscroll" example sketch in the LiquidCrystal library examples.
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am