Fixed typos, added pinmap example to dump map
This commit is contained in:
17
examples/pinmap.php
Normal file
17
examples/pinmap.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
use NoccyLabs\Gpio\GpioMapper\WiringPiMapper;
|
||||
use NoccyLabs\Gpio\Exception\GpioException;
|
||||
|
||||
$mapper = new WiringPiMapper(2);
|
||||
|
||||
$pin = 0;
|
||||
try {
|
||||
while (($gpio = $mapper->mapLogicalToGpioPin($pin))) {
|
||||
printf(" %3d = GPIO%d \n", $pin, $gpio);
|
||||
$pin++;
|
||||
}
|
||||
} catch (GpioException $e) {
|
||||
}
|
Reference in New Issue
Block a user