Skip to content

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

License

Notifications You must be signed in to change notification settings

felixthecat8a/LCD_BacklightRGB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arduino-library-badge PlatformIO Registry

LCD_BacklightRGB

GitHub Release License: MIT GitHub repo size GitHub repo file or directory count GitHub top language 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

#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() {
    // Initiate the LCD.
    lcd.begin(16, 2);
    // Initiate the RGB pins.
    backlight.begin();
    // Set the brightness level. (0 - 255)
    backlight.setBrightness(130);
    // Set the backlight using RGB values.
    backlight.setRGB(0, 255, 0);
}

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

RGB LCD Displays

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

Known Issues

  • 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

License

Stars

Watchers

Forks