NAME

RPi::WiringPi::Board - Access and manipulate Raspberry Pi board attributes

SYNOPSIS

use RPi::WiringPi;

my $pi = RPi::WiringPi->new;

my $board = $pi->board;

my $board_revision = $board->rev;

my $pin_num;
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);

DESCRIPTION

Through a RPi::WiringPi object, creates objects that has direct access to various attributes on the Rasperry Pi board itself.

METHODS

new()

Returns a new RPi::WiringPi::Board object.

rev()

Returns the revision of the Pi board.

wpi_to_gpio($pin_num)

Converts a pin number from wiringPi notation to Broadcom (BCM) notation, and returns the BCM representation.

Parameters:

$pin_num

Mandatory: The wiringPi representation of a pin number.

phys_to_gpio($pin_num)

Converts a pin number as physically documented on the Raspberry Pi board itself to Broadcom (BCM) notation, and returns it.

Parameters:

$pin_num

Mandatory: The pin number printed on the physical Pi board.

SEE ALSO

AUTHOR

Steve Bertrand, <steveb@cpan.org>

COPYRIGHT AND LICENSE

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.