Skip to content

Repository files navigation

arduino-library-badge PlatformIO Registry

LCD_BacklightRGB

GitHub Release License: MIT GitHub repo size GitHub repo file or directory count GitHub code size in bytes GitHub top language

GitHub Created At GitHub Release Date GitHub commit activity GitHub commits since latest release GitHub last commit

Check Arduino Compile Examples Spell Check

This library allows interfacing with an 18-pin RGB LCD display backlight connected directly to an Arduino board. This library is meant to be used alongside the LiquidCrystal library.

On the RGB LCD display module, set pin 15 to HIGH. Pin 16 is red, pin 17 is green and pin 18 is blue. The code is based on a function that can be used to control the colors on an RGB LED.

Installation

Install via ZIP file

  1. Download the library .zip file from the latest release.
  2. In the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library....
  3. Select the downloaded .zip file.

Install via Arduino IDE Library Manager

  1. Open the Arduino IDE.
  2. Go to Tools > Manage Libraries....
  3. In the Library Manager, type "LCD_BacklightRGB" into the search bar.
  4. Find the "LCD_BacklightRGB" library in the list and click on it.
  5. Click the Install button.

Usage

Use LCD_BacklightRGB as an RGB backlight controller separately.

#include <LiquidCrystal.h>
#include <LCD_BacklightRGB.h>
// Set up the LiquidCrystal library
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
// Set up the LCD_BacklightRGB library
const int redPin = 6, greenPin = 9, bluePin = 10;
LCD_BacklightRGB backlight(redPin, greenPin, bluePin);

void setup() {
    lcd.begin(16, 2); // Initiate the LCD.
    backlight.begin(); // Initiate the RGB pins.
    backlight.setBrightness(130); // Set the brightness level. (0 - 255)
    backlight.setRGB(0, 255, 0);// Set the backlight color.
    lcd.print("Hello World!");
}

void loop() {
    // Add your code here.
}

Or, use LCD_BacklightRGB as a LiquidCrystal wrapper.

#include <LiquidCrystal.h>
#include <LCD_BacklightRGB.h>
// Set up the LiquidCrystal library
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
LCD_BacklightRGB display(lcd, 6, 9, 10);

void setup() {
    display.begin(16, 2); // Initiate the LCD & RGB pins.
    display.setBrightness(130); // Set the brightness level. (0 - 255)
    display.setGreen();// Set the backlight color.
    display.print("Hello World!");
}

void loop() {
    // Add your code here.
}

RGB LCD Displays

Here are some of the 18-pin RGB displays that I found:

Note: I2C RGB LCD modules handle backlight colors internally

Known Issues

  • Versions > v1.2.2 will have animation helpers removed.
  • Release v1.1.1 has an issue with setting the output values. Update to the latest release to fix the issue.
  • Release v1.1.5 and earlier releases have an issue that involves compiling to the arduino-avr-mega platform. Update to the latest release to fix the issue.

About

This library enables the user to control the RGB backlight of an 18-pin LCD display connected directly to an Arduino board.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages