0

RGB LCD shield only shows blue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RGB LCD shield only shows blue

by eagleApex on Fri Jan 08, 2021 5:21 pm

I have the 2 pin RGB LCD shield https://www.adafruit.com/product/714 on a Ruggedunio, which acts like an Uno.
I'm using the sample HelloWorldRGBLCD.ino code. I initially thought it was dead, but the contrast was too high. I attached my sketch with minor changes that is currently programmed.

Currently I can print the message I want on the screen, but the only color it will display is blue.
If I press UP, DOWN or SELECT, the display is blue. If I press LEFT or RIGHT, the display goes dark.

Did I receive the wrong LCD? The shield definitely says "i2c 16x2 RGB" but the LCD LED only has 2 legs.
Attachments
HelloWorldRGBLCD.ino
(2.16 KiB) Downloaded 2 times

eagleApex
 
Posts: 2
Joined: Mon Jun 03, 2019 2:03 pm

Re: RGB LCD shield only shows blue

by franklin97355 on Fri Jan 08, 2021 7:41 pm

Please copy your code and paste it between CODE tags. Also post some pictures of the connections. Thanks.

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

Re: RGB LCD shield only shows blue

by eagleApex on Mon Jan 11, 2021 9:43 am

Attached are images of my shield. I didn't assemble it myself, as much as I wanted to. We all see only 2 legs on that LED backlight, right? Can't have RGB with two connections.

Below is first sketch for this build. It's basically the same as the example:


Code: Select all | TOGGLE FULL SIZE
/*********************

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_RGBLCDShield.h>
#include <utility/Adafruit_MCP23017.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
  Serial.begin(9600);
  // set up the LCD's number of columns and rows:
  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 :)
  lcd.setBacklight(WHITE);
  int time = millis();
  lcd.print("Hello, world!");
  time = millis() - time;
  Serial.print("Took "); Serial.print(time); Serial.println(" ms");
  lcd.setBacklight(GREEN);
}

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:
  lcd.print(millis()/1000);

  uint8_t buttons = lcd.readButtons();

  if (buttons) {
    lcd.clear();
    lcd.setCursor(0,0);
    if (buttons & BUTTON_UP) {
      lcd.print("UP Red");
      lcd.setBacklight(RED);
    }
    if (buttons & BUTTON_DOWN) {
      lcd.print("DOWN ");
      lcd.setBacklight(YELLOW);
    }
    if (buttons & BUTTON_LEFT) {
      lcd.print("LEFT ");
      lcd.setBacklight(GREEN);
    }
    if (buttons & BUTTON_RIGHT) {
      lcd.print("RIGHT ");
      lcd.setBacklight(TEAL);
    }
    if (buttons & BUTTON_SELECT) {
      lcd.print("SELECT ");
      lcd.setBacklight(VIOLET);
    }
  }
}
Attachments
IMG_2662.jpg
IMG_2662.jpg (193.5 KiB) Viewed 85 times
IMG_2661.jpg
IMG_2661.jpg (168.82 KiB) Viewed 85 times
IMG_2660.jpg
IMG_2660.jpg (735.81 KiB) Viewed 85 times

eagleApex
 
Posts: 2
Joined: Mon Jun 03, 2019 2:03 pm

Re: RGB LCD shield only shows blue

by adafruit_support_bill on Mon Jan 11, 2021 1:49 pm

That is a monochrome display. It only has 16 pins. The RGB displays have 18 pins.

adafruit_support_bill
 
Posts: 81591
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.