Hardware detection for gpio pin

This commit is contained in:
2014-06-12 00:54:55 +00:00
parent b53cabec90
commit 2fb0088528
2 changed files with 39 additions and 15 deletions

View File

@ -18,13 +18,14 @@ $gpio->setMapper( new WiringPiMapper(2) );
// be the actual GPIO0 pin.
$led = $gpio[0]
->export()
->setDirection("output")
->setValue(0)
->dumpStatus(true);
->setEdge(Gpio::EDGE_NONE)
->setDirection(Gpio::DIR_OUT)
->setLabel("LED pin")
->setValue(0);
$x = 0;
while(true) {
$x = (int)(!$x);
$led->setValue($x);
$led->setValue($x)->dumpStatus(true);
usleep(500000);
}