Raspberry Pi GPIO output driver

This driver works with HD44780-screens connected to Raspberry Pi GPIO. The screen connected has to have its RW pin tied to ground.

Sample config.json:

       "pins":[25, 24, 23, 18],
class output.drivers.pi_gpio.Screen(pins=[], rs_pin=None, en_pin=None, debug=False, **kwargs)[source]

Driver for using HD44780 displays connected to Raspberry Pi GPIO. Presumes the R/W line is tied to ground. Also, doesn’t yet control backlight.

__init__(pins=[], rs_pin=None, en_pin=None, debug=False, **kwargs)[source]

Initializes the GPIO-driven HD44780 display

All GPIOs passed as arguments will be used with BCM mapping.

  • pins: list of GPIO pins for driving display data bits in format [DB4, DB5, DB6, DB7]
  • en_pin: EN pin GPIO number. Please, make sure it’s pulled down to GND (10K is OK). Otherwise, block might start filling up the screen unexpectedly.
  • rs_pin: RS pin GPIO number,
  • debug: enables printing out LCD commands.
  • **kwargs: all the other arguments, get passed further to HD44780 constructor
write_byte(byte, char_mode=False)[source]

Takes a byte and sends the high nibble, then the low nibble (as per HD44780 doc). Passes char_mode to self.write4bits.

write4bits(bits, char_mode=False)[source]

Writes a nibble to the display. If char_mode is set, holds the RS line high.