RPi::PIGPIO::Device::LED - Turn on and off a LED
Turn on and off a led connected to a local or remote RapsberryPi
What this actually does is set the GPIO to output and allow you to set the levels to HI or LOW
use RPi::PIGPIO; use RPi::PIGPIO::Device::LED; my $pi = RPi::PIGPIO->connect('192.168.1.10'); my $led = RPi::PIGPIO::Device::LED->new($pi,17); $led->on; sleep 3; $led->off;
Create a new object
Usage:
my $led = RPi::PIGPIO::Device::LED->new($pi,$gpio);
Arguments:
$pi - an instance of RPi::PIGPIO
$gpio - GPIO number to which the LED is connected
Turn on the led
Usage :
$led->on();
Turn off the led
$led->off();
Returns the status of the led (checks if the GPIO is set to HI or LOW)
To install RPi::PIGPIO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RPi::PIGPIO
CPAN shell
perl -MCPAN -e shell install RPi::PIGPIO
For more information on module installation, please visit the detailed CPAN module installation guide.