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

View File

@ -17,12 +17,20 @@ $gpio->setMapper( new WiringPiMapper(2) );
$par = new BitmappedGpio();
for($n = 0; $n < 7; $n++) {
$par->setGpioPin($n,$gpio[$n]);
$pin = $gpio[$n]->setDirection("out");
$par->setGpioPin($n,$pin);
}
for($n = 0; $n < 10; $n++) {
for($n = 0; $n < 5; $n++) {
$par->write(0xFF);
usleep(500000);
usleep(300000);
$par->write(0x00);
usleep(300000);
}
for($n = 1; $n < 16; $n++) {
$par->write($n);
usleep(500000);
}
$par->write(0);