Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.


by shore98 on Fri May 04, 2012 9:16 pm

I have a simple question about how you connect the lcd to the shield. Do you line up the pins on the right or the left side? The shield has 18 holes and the lcd has only 16 pins.
Posts: 2
Joined: Sun Apr 29, 2012 2:26 am

Re: PN772

by franklin97355 on Fri May 04, 2012 10:45 pm

You should find what you need here http://ladyada.net/make/rgblcdshield/

Posts: 16668
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: PN772

by shore98 on Sat May 05, 2012 5:22 am

Thanks, I now have a second problem, the backlight works fine, the example program loads but no text shows up. I run the serial monitor and it seems to work also. The program loads with no errors.


Example code for the Adafruit RGB Character LCD Shield and Library

This code displays text on the shield, and also reads the buttons on the keypad.
When a button is pressed, the backlight changes color.


// include the library code:
#include <Wire.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>

// The shield uses the I2C SCL and SDA pins. On classic Arduinos
// this is Analog 4 and 5 so you can't use those for analogRead() anymore
// However, you can connect other I2C sensors to the I2C bus and share
// the I2C bus.
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

// These #defines make it easy to set the backlight color
#define RED 0x1
#define YELLOW 0x3
#define GREEN 0x2
#define TEAL 0x6
#define BLUE 0x4
#define VIOLET 0x5
#define WHITE 0x7

void setup() {
// Debugging output
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);

// Print a message to the LCD. We track how long it takes since
// this library has been optimized a bit and we're proud of it :)
int time = millis();
lcd.print("Hello, world!");
time = millis() - time;
Serial.print("Took "); Serial.print(time); Serial.println(" ms");

uint8_t i=0;
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:

uint8_t buttons = lcd.readButtons();

if (buttons) {
if (buttons & BUTTON_UP) {
lcd.print("UP ");
if (buttons & BUTTON_DOWN) {
lcd.print("DOWN ");
if (buttons & BUTTON_LEFT) {
lcd.print("LEFT ");
if (buttons & BUTTON_RIGHT) {
lcd.print("RIGHT ");
if (buttons & BUTTON_SELECT) {
lcd.print("SELECT ");
Posts: 2
Joined: Sun Apr 29, 2012 2:26 am

Re: PN772

by adafruit on Sat May 05, 2012 4:29 pm

post a photo showing the assembled kit & your setup, we'll check it out!

Posts: 12131
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Please be positive and constructive with your questions and comments.