in reply to How to make a variable in hard call.
I can't test since I have no RPI, but Device::BCM2835 seems to export all functions and constants by default.
so please try
gpio_fsel(RPI_V2_GPIO_P1_07, $inputcmd);
alternatively preceded by
use Device::BCM2835 qw/gpio_fsel RPI_V2_GPIO_P1_07 ... etc/;
or
use Device::BCM2835 ':all';
This should shorten your code considerably.
The rest of your question is a bit fuzzy, please explain.
probably something like my $pin1 = RPI_V2_GPIO_P1_07 is just what you want?
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
|
|---|