Device::Serdisp - Perl extension for talking to the serdisplib
use Device::Serdisp; my $d = Device::Serdisp->new('USB:7c0/1501', 'ctinclud'); $d->init(); $d->clear(); # reserves a color-indexed picture my $image = GD::Image->new(128,64); my $black = $image->colorAllocate(0,0,0); my $white = $image->colorAllocate(255,255,255); $image->transparent($black); $image->arc(10,10,10,10,0,270, $white); $d->copyGD($image);
This library is a quick interface to serdisplib.
$d = Device::Serdisp->new(connection,displaytype)
This will open the serdisp library for you. The first string is connector string that describes the kind of interface your are using to talk to your display:
Examples:
/dev/parport0 - parallel port 0x378 - direct IO USB:7c0/1501 - USB device with the given product id ...
The second is the type of the display.
ctinclud PCD8544 ...
$d->init()
This will init the display and turn it on. The the display can't found with your specified parameter the method will croak.
$d->width()
Returns the width of the display in pixel.
$d->copyGD(GD)
This will copy your given GD object into the buffer of the serdisp library. After that the display will be updated to display the content of the internal buffer. All non-black pixels (red >0 || green > 0 || blue > 0) will be translated to a set pixel on the display. No dithering at all!
If you GD area is bigger than your display the rest of the GD area will be ignored.
If you GD area is lesser than your display the rest of the display area will be untouched.
$d->clear()
Will clear the internal buffer of the serdisp library and force an update of the display.
$d->set_option(OPTION, VALUE)
Will set an option for the display. Valid values for OPTION depends on the type of your display and may vary.
Example:
$d->set_option("INVERT","1");
$d->get_option(OPTION)
This will return the current value of the display.
None by default.
GD - http://www.boutell.com/gd/ GD - perldoc GD Serdisplib - http://serdisplib.sourceforge.net/
Erik Wasser, <erik.wasser@iquer.net>
Copyright (C) 2006 by Erik Wasser
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 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:
You forgot a '=back' before '=head2'
To install Device::Serdisp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Serdisp
CPAN shell
perl -MCPAN -e shell install Device::Serdisp
For more information on module installation, please visit the detailed CPAN module installation guide.