CustomizableTextLCD

The TextLCD library makes it easy to write text to a 2x16 LCD module, but it's not so easy to use it with another sized LCD, or to one that's not exactly the same as the one the library was designed for. This project aimed to fill that void by providing a mechanism to allow the parameters of the library to be changed without having to edit the source of the library.

Hardware

The hardware used for this project is a Supertwist DEM16217:

source:/Project/doc/ProjectInterface.png source:/Project/doc/ProjectProduct.png
  • The items used in this project can be bought from Maplin

Software

Right-click the project to import to, select "Import Library..." and use the following details:

View the library

Hello World!

source:/Project/doc/ProjectSchematic.png source:/Project/doc/ProjectPhoto.png
Schematic Photo
#include "mbed.h"
#include "TextLCD.h"

class TextLCD_DEM16217 : public TextLCD {
public:
    TextLCD_DEM16217(int rs, int rw, int e,
                     int d0, int d1, int d2, int d3) :
        TextLCD(rs, rw, e, d0, d1, d2, d3) {}
protected:
    virtual int bytesPerRow() const { return 0x40; }
};
TextLCD_DEM16217 lcd(24, 25, 26, 27, 28, 29, 30);
int main() {
    lcd.locate(2,1);
    lcd.printf("Hello World!");
}
HelloWorldDEM16217.bin
Source Code Binary

Resources

Datasheets

PCB Library and Footprint

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

The Library for the CustomizableTextLCD is the same as TextLCD:


Development Log

I've had to power the DEM16217 using 5.0v, but it should be possible to power it using 3.3v - just haven't found the runes yet.

No pictures yet because I'm in the middle of another project, but will do this soon.

Would be nice to have a look at other LCDs and see if the customizable parameters are correct. Is there anything else that may vary?