Hd44780

javadoc
The HD44780 is the primary chip for a 16 character x 2 line LCD display.
 
These small displays can be found cheap online and are easy to use with a device with an I2C bus master.
You will find this on the Raspberry Pi and the Arduino Micro Controllers.
 
The display uses 7 inputs on the board to interface with the controller, but to make it I2C compatible, a PCF8574 is required.
This also gives us the ability to use the list output on the PCF8574 to control the LED backlight.
 
To help us use this dispaly, Moz4r created a service giving us a simple way to drive it from out code.
Pre-requits for this service is a device with an I2C Master and the PCF8574 service.
 

Example for develop:

#file : Hd44780.py edit raw

#################################################################
# Example Code                                                  #
#################################################################
 
#################################################################
# First start your I2C Bus Master Device                        #
#################################################################
# If your using the Arduino Nano, comment out this line and
# uncomment the ArDuino Nano lines
raspi = Runtime.start("raspi","RasPi")
#################################################################
# Start the Arduino Nano connected using /dev/ttyUSB0           #
#################################################################
#arduinoNano = Runtime.start("arduinoNano","Arduino")
#arduinoNano.setBoardNano()
#arduinoNano.connect("/dev/ttyUSB0")
 
#################################################################
# Next start the PCF8574 service                                #
#################################################################
pcf = Runtime.start("Pcf","Pcf8574")
# Then attach it to the I2C Bus Master
# When attaching, we specify the Bus Master Device,
# the I2C Bus Number
# and the I2C address
pcf.setBus("1")
pcf.setAddress("0x27")
pcf.attach(raspi)
 
#pcf.attach(arduinoNano,"0","0x27")
 
#################################################################
# Next start the Hd44780 service                                #
#################################################################
hd44780 = Runtime.start("hd44780","Hd44780")
 
# Once the service has been started, we need to attach it to
# the PCF service
hd44780.attach(pcf)
 
# this will initalise the display.
hd44780.init()
 
# when we want to clear the screen call this
hd44780.clear()
 
# You can turn the backlight on or off.
# True will turn it on, False will turn it off.
hd44780.stBackLight(True)
 
# Filally to send text to the display
hd44780.display("Hello World", 0)