RPi::WiringPi::Board - Access and manipulate Raspberry Pi board attributes
use RPi::WiringPi; my $pi = RPi::WiringPi->new; my $board = $pi->board; my $board_revision = $board->rev; my $pin_num = 5; my $wpi_to_gpio = $board->wpi_to_gpio($pin_num); my $phys_to_gpio = $board->phys_to_gpio($pin_num); print "rev: $board_revision\n" . "wiringPi pin $pin_num translated to gpio pin num: $wpi_to_gpio\n" . "physical pin $pin_num translated to gpio pin num: $phys_to_gpio"; # change the Pulse Width Modulation (PWM) range maximum $board->pwm_range(512);
Through a RPi::WiringPi object, creates objects that has direct access to various attributes on the Rasperry Pi board itself.
Returns a new RPi::WiringPi::Board object.
RPi::WiringPi::Board
Returns the revision of the Pi board.
Converts a pin number from wiringPi notation to Broadcom (BCM) notation, and returns the BCM representation.
wiringPi
Parameters:
$pin_num
Mandatory: The wiringPi representation of a pin number.
Converts a pin number as physically documented on the Raspberry Pi board itself to Broadcom (BCM) notation, and returns it.
Mandatory: The pin number printed on the physical Pi board.
Steve Bertrand, <steveb@cpan.org>
Copyright (C) 2016 by Steve Bertrand
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.
To install RPi::WiringPi, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RPi::WiringPi
CPAN shell
perl -MCPAN -e shell install RPi::WiringPi
For more information on module installation, please visit the detailed CPAN module installation guide.