Hardware detection for gpio pin
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user