JHD-2X16-I2C Display 16x2 I2C Interface Display.
The JHD-2X16-I2C display is a 16x2 LCD screen (16 characters × 2 lines) based on the Hitachi HD44780 controller, but with an I2C backpack module attached. This backpack significantly reduces the number of pins needed to interface with an Arduino or other microcontroller — from 16 down to just 4 (VCC, GND, SDA, SCL).Pinout (I2C Backpack)
- GND – Ground
- VCC – Power (usually 5V)
- SDA – Serial Data (connect to A4 on Arduino Uno)
- SCL – Serial Clock (connect to A5 on Arduino Uno)
Library Download
Arduino code,
#include <Wire.h>
#include "DFRobot_LCD.h"
const int colorR = 255;
const int colorG = 0;
const int colorB = 0;
DFRobot_LCD lcd(16,2); //16 characters and 2 lines of show
void setup() {
// initialize
lcd.init();
lcd.setRGB(colorR, colorG, colorB);//If the module is a monochrome screen, you need to shield it
// Print a message to the LCD.
lcd.print("www.thetargettech.com!");
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);
}
0 Comments