Code Monkey home page Code Monkey logo

lcd_backlightrgb's Introduction

arduino-library-badge GitHub Release License: MIT

LCD_BacklightRGB

This library allows interfacing with an 18-pin RGB LCD display backlight connected directly to an Arduino board. It enables the user to control the RGB backlight using Arduino. 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. This sketch will loop through the different colors and display the color name. 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);
    lcd.print("Green!");
    delay(500);
    lcd.clear();
}

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

RGB LCD Displays

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

lcd_backlightrgb's People

Contributors

felixthecat8a avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.