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