notes on using a NHD-0216BZ-RN-YBW 16x2 LCD with an Arduino Uno

This blog post exemplifies the practical use of a NHD-0216BZ-RN-YBW 16x2 character LCD module in embedded systems. Featuring an ST7066U controller, this LCD is commonly used in Arduino and other microcontroller projects. Following, pointers on working with the parallel interface to display characters effectively are presented. This module, known for its reflective design and lack of backlighting, is an excellent choice for applications where power efficiency is key. For more in-depth technical details, you can also check the datasheets and application notes provided by the manufacturer [1].

Example


Materials

- Arduino UNO
- USB cable
NHD-0216BZ-RN-YBW 16x2 LCD
- breadboard
- wires

Setup



Additional notes on the NHD-0216BZ-RN-YBW 16x2 LCD [1]


Sketch

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}

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

References


Comments