NAME
Device::BCM2835::LCD - Perl extension for driving an HD44780 LCD from a Raspberry Pi's GPIO port
VERSION
Version 0.02
SYNOPSIS
use Device::BCM2835::LCD;
# Init display, specifying the GPIO pin connections
my $foo = Device::BCM2835::LCD->new();
$foo->init(
Display => 2004,
RPI_PIN => V2,
pin_rs => RPI_GPIO_P1_24,
pin_e => RPI_GPIO_P1_23,
pin_d4 => RPI_GPIO_P1_07,
pin_d5 => RPI_GPIO_P1_11,
pin_d6 => RPI_GPIO_P1_13,
pin_d7 => RPI_GPIO_P1_15
);
# print text to the screen
$foo->PutMsg("Hello");
# move cursor to line 2, col 0
$foo->SetPos(2,0);
# print text on second line
$foo->PutMsg("world!");
# Clear the LCD screen
$foo->ClearDisplay;
# bignums - position, number
# display "123"
$foo->BigNum(0,1);
$foo->BigNum(1,2);
$foo->BigNum(2,3);
SUBROUTINES/METHODS
new
init([pin_rs => $pin], [pin_e => $pin], [pin_d4 => $pin] .. [pin_d7 => $pin], [RPI_PIN => V1] )
Initialises the LCD display, using either the default wiring arrangement or the pins specified with init(). RPI_PIN refers to the P1 header GPIO mapping scheme. Early boards use 'V1', B+ and revision 2 boards use RPI_PIN V2. The default is V2 pinout.
Default wiring is: pin_rs => RPI_GPIO_P1_24 pin_e => RPI_GPIO_P1_23 pin_d4 => RPI_GPIO_P1_07 pin_d5 => RPI_GPIO_P1_11 pin_d6 => RPI_GPIO_P1_13 pin_d7 => RPI_GPIO_P1_15 RPI_PIN => V2
SetPos(line,column)
Moves the cursor to the specified position.
The top/left position of a 20x4 LCD is (1,0),
with the bottom/right being (4,19)
ClearDisplay
Clears all characters from the display
PutMsg($msg)
writes the string $msg to the display starting
at the current cursor position.
Note that a 4 line display will wrap line 1 to 3, and 2 to 4.
Delay($milliseconds)
Delay for $milliseconds ms.
BigNum($position,$digit)
Displays $digit in 4x4 large font at position $position.
A 20x4 display has 5 positions (0-4), a 16x4 display has 4.
This will only work with 4 line displays.
cmd($instruction)
Writes command $instruction to the display.
Useful instructions are:
cmd(1) - clear display
cmd(8) - switch off display
cmd(12) - switch on display
AUTHOR
Joshua Small, <josh at festy.org>
BUGS
Please report any bugs or feature requests to bug-device-bcm2835-lcd at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Device-BCM2835-LCD. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Device::BCM2835::LCD
You can also look for information at:
* RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Device-BCM2835-LCD
* AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Device-BCM2835-LCD
* CPAN Ratings
http://cpanratings.perl.org/d/Device-BCM2835-LCD
* Search CPAN
http://search.cpan.org/dist/Device-BCM2835-LCD/
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
Copyright 2015 Joshua Small.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.