Device::BCM2835::LCD - Perl extension for driving an HD44780 LCD from a Raspberry Pi's GPIO port
Version 0.02
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);
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
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)
Clears all characters from the display
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 for $milliseconds ms.
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.
Writes command $instruction to the display. Useful instructions are: cmd(1) - clear display cmd(8) - switch off display cmd(12) - switch on display
Joshua Small, <josh at festy.org>
<josh at festy.org>
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.
bug-device-bcm2835-lcd at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Device::BCM2835::LCD
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Device-BCM2835-LCD
http://annocpan.org/dist/Device-BCM2835-LCD
http://cpanratings.perl.org/d/Device-BCM2835-LCD
http://search.cpan.org/dist/Device-BCM2835-LCD/
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.
To install Device::BCM2835::LCD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::BCM2835::LCD
CPAN shell
perl -MCPAN -e shell install Device::BCM2835::LCD
For more information on module installation, please visit the detailed CPAN module installation guide.