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 = 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);

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.

pwm_range($range)

Changes the range of Pulse Width Modulation (PWM). The default is 0 through 1024.

Parameters:

$range

Mandatory: An integer specifying the high-end of the range. The range always starts at 0. Eg: if $range is 359, if you incremented PWM by 1 every second, you'd rotate a step motor one complete rotation in exactly one minute.

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.