TextLCD

This is a LCD display that can display two rows of 16 alphanumeric characters.

Library

Note: For a experimental new generic text display library, see http://mbed.org/forum/topic/195/?page=1#comment-1068

Import Library:

http://mbed.org/projects/cookbook/svn/TextLCD/trunk

Import Example program:

http://mbed.org/projects/cookbook/svn/TextLCD/example

Hello World!

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3

int main() {
    lcd.printf("Hello World!");
}

source:/TextLCD/doc/TextLCDSchematic.png source:/TextLCD/doc/TextLCDPhoto1.jpg

API

TextLCDA 16x2 Text LCD controller
Functions
TextLCDCreate a TextLCD object, connected to the specified pins
putcWrite a character
printfWrite a formated string
locateLocate to a certian position
clsClear the screen, and locate to 0,0
class TextLCD : public Stream
A 16x2 Text LCD controller
TextLCD(PinName rs,  
PinName rw,  
PinName e,  
PinName d0,  
PinName d1,  
PinName d2,  
PinName d3,  
int columns =  16,
int rows =  2)
Create a TextLCD object, connected to the specified pins
int putc(int c)
Write a character
int printf(const char *format,
 ...)
Write a formated string
virtual void locate(int column,
int row)
Locate to a certian position
virtual void cls()
Clear the screen, and locate to 0,0

Details

source:/TextLCD/doc/TextLCDInterface.png source:/TextLCD/doc/TextLCDProduct.jpg

Screen Layout

pin   1                             16
    +-------------------------------------------------+
    | o o o o o o o o o o o o o o o o                 |
    | +---------------------------------------------+ |
    | | (0,0)                                (15,0) | |
    | |             Screen Location                 | |
    | | (0,1)                                (15,1) | |
    | +---------------------------------------------+ |
    +-------------------------------------------------+

Resources

Datasheets

PCB Library and Footprint

The Eagle PCB repository can be found at the Eagle page.