4x20 LCD: Only 2 Lines Work

Breakout boards, sensors, Drawdio, Game of Life, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

4x20 LCD: Only 2 Lines Work

Postby DWW » 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

Postby adafruit_support_bill » Wed Jan 23, 2013 1:46 pm

In setup(), change lcd.begin(16, 2); to lcd.begin(20, 4);
Code: Select all
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: 16617
Joined: Sat Feb 07, 2009 9:11 am

Re: 4x20 LCD: Only 2 Lines Work

Postby DWW » 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

Postby adafruit_support_bill » Thu Jan 24, 2013 5:20 am

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


Then you call
Code: Select all
xxxxx.begin(20, 4)


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

Re: 4x20 LCD: Only 2 Lines Work

Postby DWW » 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

Postby adafruit_support_bill » Thu Jan 24, 2013 2:04 pm

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


Return to Other Adafruit products

Who is online

Users browsing this forum: No registered users and 4 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]