NAME
RPi::PIGPIO::Device::Switch - Turn on and off a switch
DESCRIPTION
Turn on and off a device 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
The device can be enything that accept TTL signal as a command (eg: relay, LED )
METHODS
new
Create a new object
Usage:
my $led = RPi::PIGPIO::Switch->new($pi,$gpio);
Arguments: $pi - an instance of RPi::PIGPIO $gpio - GPIO number to which the device is connected
on
Turn on the connected device (set the TTL level to HI on the GPIO)
Usage :
$switch->on();
off
Turn off the led (set the TTL level to LOW on the GPIO)
Usage :
$switch->off();
status
Returns the status of the device (checks if the GPIO is set to HI or LOW)