Contents Up Previous Next

HiPi::BCM2835::Pin

HiPi::BCM2835::Pin provides an implementation of HiPi::Pin for the HiPi::BCM2835 module.

The module inherits all of its methods from HiPi::Pin.

See Also

Example Usage

use 5.14.0; # for say
use HiPi::BCM2835;
use HiPi::Constant qw( :raspberry );

my $bcm  = HiPi::BCM2835->new();
my $pin  = $bcm->get_pin( RPI_PAD1_PIN_11 );
my $mode = $pin->mode();

if( $mode & RPI_PINMODE_OUTP ) {
    # set high
    $pin->value(1);
} elsif(  $mode & RPI_PINMODE_INPT ) { 
    say q(Current Pin Value is :) . $pin->value();

    # set rising edge interrupt
    $pin->interrupt( RPI_INT_RISE );
}




Contents Up Previous Next


HiPi Modules Copyright © 2013 Mark Dootson