The earlier post “Clocks – Part 1: HD44780 16X2 LCD” showed connecting a HD44780 16×02 LCD module to the Raspberry Pi and displaying the date and time.
I’ve taken the code to drive the display and made a class so that it can be used in other projects.
In time, I may extend this for other display sizes (20×4), types (graphical) and interfaces (I2C, etc).
At the moment, the class handles the 4 bit HD44780 16×2 Character LCD. It’s very simple and provides member functions to initialise, clear and write text to each of the 2 lines.
It can be downloaded here.