setMapper( new WiringPiMapper(2) ); // Access logical pin 0, since we got a mapper assigned. Otherwise this would // be the actual GPIO0 pin. $led = $gpio[LED_A] ->export() ->setEdge(Gpio::EDGE_NONE) ->setDirection(Gpio::DIR_OUT) ->setLabel("LED pin") ->setValue(0); // Flash the led $x = 0; while(true) { $x = (int)(!$x); $led->setValue($x)->dumpStatus(true); usleep(500000); }