Saturday, April 27, 2024
ESPHow ToIoT HardwaresTutorials/DIY

How To Use Grove-LCD RGB Backlight with NodeMCU

This Grove-LCD RGB Backlight enables you to set the color to whatever you like via the simple and concise Grove interface. It takes I2C as communication method with your microcontroller. So number of pins required for data exchange and backlight control shrinks from ~10 to 2, relieving IOs for other challenging tasks. Besides, Grove – LCD RGB Backlight supports user-defined characters. Want to get a love heart or some other foreign characters?

Features

  • RGB Backlight
  • I2C communication
  • Built-in English fonts
  • 16×2 LCD

Specification

Item Value
Input Voltage 5V
Operating Current <60mA
CGROM 10880 bit
CGRAM 64×8 bit
LCD I2C Address 0X3E
RGB I2C Address 0X62

Play With NodeMCU Using Arduino IDE

If You Don’t know How To Use ESP8266 with Arduino Please visit this post given below.

Arduino Support for ESP8266 with simple test code

  • Open Arduino IDE.
  •  Download the Grove-LCD RGB Backlight Library from Github.
  •  Since you have downloaded the zip Library, open your Arduino IDE, click on Sketch > Include Library > Add .ZIP Library
  • Here are 12 examples in the library as below.
    • Autoscroll
    • Blink
    • Cursor
    • CustomCharacter
    • Display
    • fade
    • HelloWorld
    • Scroll
    • SerialDisplay
    • setColor
    • setCursor
    • TextDirection
  • Please follow below picture to select example HelloWorld and upload the arduino.

Here is the code of HelloWorld.ino.

#include <Wire.h>
#include "rgb_lcd.h"

rgb_lcd lcd;

const int colorR = 255;
const int colorG = 0;
const int colorB = 0;

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

    lcd.setRGB(colorR, colorG, colorB);

    // Print a message to the LCD.
    lcd.print("hello, world!");

    delay(1000);
}

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);

    delay(100);
}
  • We will see the hello world on LCD.

Pin Connection

Use Vin Pin for Power supply to Grove LCD RGB Backlight. Because Grove LCD RGB Backlight needs 5V power supply.

Harshvardhan Mishra

Hi, I'm Harshvardhan Mishra. Tech enthusiast and IT professional with a B.Tech in IT, PG Diploma in IoT from CDAC, and 6 years of industry experience. Founder of HVM Smart Solutions, blending technology for real-world solutions. As a passionate technical author, I simplify complex concepts for diverse audiences. Let's connect and explore the tech world together! If you want to help support me on my journey, consider sharing my articles, or Buy me a Coffee! Thank you for reading my blog! Happy learning! Linkedin