The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RPi::WiringPi::LCD - Perl interface to Raspberry Pi LCD displays via the GPIO pins

DESCRIPTION

WARNING: Until version 1.00 has been released, the API along with functionality may change at any time without any notice. If you happen to be testing with this software and find something broken, please contact me.

METHODS

new()

Returns a new WiringPi::API object.

init(%args)

Initializes the LCD library, and returns an integer representing the handle handle (file descriptor) of the device. The return is supposed to be constant, so DON'T change it.

Parameters:

    %args = (
        rows => $num,       # number of rows. eg: 16 or 20
        cols => $num,       # number of columns. eg: 2 or 4
        bits => 4|8,        # width of the interface (4 or 8)
        rs => $pin_num,     # pin number of the LCD's RS pin
        strb => $pin_num,   # pin number of the LCD's strobe (E) pin
        d0 => $pin_num,     # pin number for LCD data pin 1
        ...
        d7 => $pin_num,     # pin number for LCD data pin 8
    );

Mandatory: All entries must have a value. If you're only using four (4) bit width, d4 through d7 must be set to 0.

home()

Moves the LCD cursor to the home position (top row, leftmost column).

clear()

Clears the LCD display of all data.

display($state)

Turns the LCD display on and off.

Parameters:

    $state

Mandatory: 0 to turn the display off, and 1 for on.

cursor($state)

Turns the LCD cursor on and off.

Parameters:

    $state

Mandatory: 0 to turn the cursor off, 1 for on.

cursor_blink($state)

Parameters:

    $state

Mandatory: 0 to stop blinking, 1 to enable.

send_cmd($command)

Sends any arbitrary command to the LCD. (I've never tested this!).

Parameters:

    $command

Mandatory: A command to submit to the LCD.

position($x, $y)

Moves the cursor to the specified position on the LCD display.

Parameters:

    $x

Mandatory: Column position. 0 is the left-most edge.

    $y

Mandatory: Row position. 0 is the top row.

char_def($index, $data)

This allows you to re-define one of the 8 user-definable characters in the display. The data array is 8 bytes which represent the character from the top-line to the bottom line. Note that the characters are actually 5×8, so only the lower 5 bits are used. The index is from 0 to 7 and you can subsequently print the character defined using the lcdPutchar() call.

Parameters:

    $index

Mandatory: Index of the display character. Values are 0-7.

    $data

Mandatory: See above description.

Writes a single ASCII character to the LCD display, at the current cursor position.

Parameters:

    $char

Mandatory: A single ASCII character.

print($string)

Parameters:

    $string

Mandatory: A string to display.

AUTHOR

Steve Bertrand, <steveb@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2016 by Steve Bertrand

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 185:

Non-ASCII character seen before =encoding in '5×8,'. Assuming UTF-8