Professional Documents
Culture Documents
LCD 16x2
LCDs (Liquid Crystal Displays) are used in embedded system applications for displaying various parameters and status of the
system.
LCD 16x2 is a 16-pin device that has 2 rows that can accommodate 16 characters each.
LCD 16x2 can be used in 4-bit mode or 8-bit mode.
It is also possible to create custom characters.
It has 8 data lines and 3 control lines that can be used for control purposes.
For more information about LCD 16x2 and how to use it, refer the topic LCD 16x2 module in the sensors and modules section.
Interfacing Diagram
Example
Here, we are using TextLCD library, developed by Simon Ford for controlling various LCD panels based on the HD44780 4-bit
interface.
You can find more information about the TextLCD library from here.
Program
#include "mbed.h"
#include "TextLCD.h"
TextLCD lcd(p5, p6, p7, p8, p9, p10);//RS, RW, D4, D5, D6, D7
int main() {
int a=0;
lcd.printf("Hello World!\n");
while(1)
lcd.locate(0,1);
lcd.printf("%d",a);
wait(1);
a++;