DF-Robot LCD Display vs.  Arduino Mega

I bought an LCD Display from Virtual Village. It says it's made by DF Robot. I can't seem to get it to work with my Arduino Mega.


The docs on the DF Robot site say to use the LCD4bit library, but neither that nor any other library seems to do anything. The display is bright blue, but no characters ever appear.

One suspicious thing about the LCD4Bit library is that the examples only use 1-line of the display, and this is clearly a 2-line display.

Thanks. I'm a newbie...

Hey! I got it working! There was a multi-turn potentiometer on the board, and I finally worked up the nerve to crank it until it stopped. Voila! Now both the LCD4bit examples and LiquidCrystal library examples work. For the Liquid Crystal libraries, use this line of code to set the pins:

LiquidCrystal lcd(8,9,4,5,6,7);

So I suppose that the pot. is a dimmer. It might be nice if the docs had just said so. As a newbie, the Arduino vendors seem to have a culture of zero documentation. What's up with that?

So I suppose that the pot. is a dimmer. It might be nice if the docs had just said so.

Did you look at page 13 of the documentation?


Ahhh, now I see. There's a little text label on the image. Thanks for spotting that, I feel a little better about it now. Of course the place I bought it from didn't even bother to tell me it came from DF Robot. Virtual Village just chucked it in an envelope and mailed it. It took some sleuthing to get as far as the DF Roboto site.

On that same photo, they label the jumpers next to the contract control "ICSP". Do you by any chance know what that is?


"ICSP" means "In Circuit Serial Programming". It's a different method for programming the microprocessor. It is sometimes labeled "ISP" for "In System Programming".


This works for me…

#include <LiquidCrystal.h>


This program will test the LCD panel and the buttons
Mark Bramwell, July 2010


// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

// define some values used by the panel and buttons
int lcd_key = 0;
int adc_key_in = 0;
#define btnRIGHT 0
#define btnUP 1
#define btnDOWN 2
#define btnLEFT 3
#define btnSELECT 4
#define btnNONE 5

// read the buttons
int read_LCD_buttons()
adc_key_in = analogRead(0); // read the value from the sensor
// my buttons when read are centered at these valies: 0, 144, 329, 504, 741
// we add approx 50 to those values and check to see if we are close
if (adc_key_in > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result
if (adc_key_in < 50) return btnRIGHT;
if (adc_key_in < 195) return btnUP;
if (adc_key_in < 380) return btnDOWN;
if (adc_key_in < 555) return btnLEFT;
if (adc_key_in < 790) return btnSELECT;
return btnNONE; // when all others fail, return this…

void setup()
lcd.begin(16, 2); // start the library
lcd.print(“Push the buttons”); // print a simple message

void loop()
lcd.setCursor(9,1); // move cursor to second line “1” and 9 spaces over
lcd.print(millis()/1000); // display seconds elapsed since power-up

lcd.setCursor(0,1); // move to the begining of the second line
lcd_key = read_LCD_buttons(); // read the buttons

switch (lcd_key) // depending on which button was pushed, we perform an action
case btnRIGHT:
lcd.print("RIGHT ");
case btnLEFT:
lcd.print("LEFT ");
case btnUP:
lcd.print("UP ");
case btnDOWN:
lcd.print("DOWN ");
case btnSELECT:
case btnNONE:
lcd.print("NONE ");