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) ->setLabel("red led") ->dumpStatus(true); $btn1 = $gpio[1] ->setDirection("input") ->setValue(0) ->setEdge("rising") ->setHandler(function() { echo "INTERRUPT!\n"; }) ->setLabel("button 1") ->dumpStatus(true); $btn2 = $gpio[2] ->setDirection("input") ->setValue(0) ->setEdge("rising") ->setHandler(function() { echo "INTERRUPT!\n"; }) ->setLabel("button 2") ->dumpStatus(true);