NAME
Device::PaPiRus - Raspberry Pi "PaPiRus" e-paper display
SYNOPSIS
use Device::PaPiRus;
use GD;
my $img = GD::Image->new('cvc.png');
my $papirus = Device::PapiRus->new();
$papirus->setThreshold(100);
$papirus->fullUpdate($img);
DESCRIPTION
Device::PaPiRus is a library to use the PaPiRus e-paper display from Perl with the help of the GD image library.
The Image must match the size of the panel exactly. Also the transformation to a single-bit black&white image in this library is rather simple: take the average of R+G+B to make it greyscale, then see if it's above the given threshold.
While the implementation is simple, it still allows you a few simple "animations" with whatever framerate you can get out of your panel. For example, if you have a white-to-black gradient in the image, you can move the threshold and repaint the image to make a simple "moving" animation. Also, you can set either randomize the white or black pixels while repainting the image over and over again. Nothing fancy, for more elaborate stuff look into the GD library itself.
FUNCTIONS
new
Takes no arguments. Checks for a display panel and reads out its size.
getWidth
Returns the width of the panel in pixels.
getHeight
Returns the height of the panel in pixels.
setThreshold
Sets the threshold of where black ends and white begins. Default: 150
randomizeWhite
A true value means white pixels are randomized. Default: false
randomizeBlack
A true value means black pixels are randomized. Default: false
fullUpdate
Does a "full" update of the display panel (complete clearing by inverting pixels and stuff). Slow and annoying, but guarantuees that all pixels are nice, shiny and in the correct color.
partialUpdate
Does a "partial" update of the display panel. This only overwrites pixels that have changed. A bit quicker than a full update, no annoying going-to-black-and-back flicker, but may leave artifacts. If you need "quick" screen updates for a demo, a partial update is the way to go. If you want very crisp text, you should choose a full update, at least every few screen updates.
INSTALLATION NOTES
This module uses the EPD fuse module from the rePaper project for low level device access. Something like this should get you going on Raspbian:
First, enable SPI in raspi-config (make sure it's loaded on boot).
Then:
sudo apt-get install libfuse-dev python-imaging python-setuptools
sudo easy_install pip
git clone https://github.com/repaper/gratis.git
cd gratis/PlatformWithOS
make PANEL_VERSION=V231_G2 rpi-epd_fuse
sudo make PANEL_VERSION=V231_G2 rpi-install
The next step is to edit /etc/default/epd-fuse. Make sure you got the correct panel size (EPD_SIZE) selected (for example 2.7).
Then reboot. If there is a problem, try
sudo service epd-fuse start
There's also a manual from Adafruit here: https://learn.adafruit.com/repaper-eink-development-board-arm-linux-raspberry-pi-beagle-bone-black?view=all. Beware, the Adafruit manual is based on a slightly older library and uses a slightly different panel.
SEE ALSO
Mention other useful documentation such as the documentation of related modules or operating system documentation (such as man pages in UNIX), or any relevant external documentation such as RFCs or standards.
If you have a mailing list set up for your module, mention it here.
If you have a web site set up for your module, mention it here.
AUTHOR
Rene Schickbauer, <rene.schickbauer@gmail.com>
COPYRIGHT AND LICENSE
Copyright (C) 2008-2016 by Rene Schickbauer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.