in reply to How to make a variable in hard call.
my %GPIO = (
1 => \&Device::BCM2835::RPI_V2_GPIO_P1_01,
# [...]
7 => \&Device::BCM2835::RPI_V2_GPIO_P1_07
);
# [...]
my $pin = 7; # Or however you decide on the correct pin
Device::BCM2835::gpio_fsel($GPIO{$pin}->(), $inputcmd);
|
|---|