Main Site Contents Up Previous Next


HiPi::Interface::SerLCD provides an implementation of HiPi::Interface::HD44780 for LCD devices using the Sparkfun SerLCD controller.

The module inherits many of its methods from HiPi::Interface::HD44780.

Object Constructor and Methods

The module can accept one of the following literal values 
when using the inherited 'update_baudrate' method.
    2400, 4800, 9600, 14400, 19200, 38400
The following are the methods specific to this implementation. 
See HiPi::Interface::HD44780 for inherited methods.

my $lcd = HiPi::Interface::SerLCD->new( %params );
    %params  contains a number of key value pairs
    Required key value pairs
      width   =>  $width
      lines   =>  $lines

    You must specify the geometry of your LCD
    my $lcd = HiPi::Interface::SerLCD->new( 
        width =>  16,
        lines =>  4,
    Optional params and their defaults
    backlightcontrol => 0
    specify if methods setting the level of backlight can be used.
    The method $lcd->backlight will only work if you set
    backlightcontrol => 1 in the constructor.
    devicename      => '/dev/ttyAMA0'
    baudrate        => 9600
    parity          => 'none',
    stopbits        => 1,
    databits        => 8,

    If you are using a Pi 3 with default settings, the header pins
    on the Rpi gpio are connected to the mini uart. You will therefore need
    to specify the device to override the default.

    my $dev = HiPi::Interface::SerLCD->new(
        devicename   => '/dev/ttyS0',

    Example complete constructor call:
    my $lcd = HiPi::Interface::SerLCD->new( 
        width            => 16,
        lines            => 4,
        backlightcontrol => 1,
        devicename       => '/dev/ttyS0',
    Toggles splash screen display on / off
    Sets the current top 2 lines of text as the splash screen.
    If the SerLCD gets into an unknown state, call 
    this to reset the LCD to default settings.

Contents Up Previous Next

HiPi Modules Copyright © 2013 - 2016 Mark Dootson