Fixed typos, added pinmap example to dump map

This commit is contained in:
2014-06-13 00:02:39 +00:00
parent 755552a9a6
commit 17dd85f828
3 changed files with 30 additions and 4 deletions

17
examples/pinmap.php Normal file
View 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) {
}