Updated basic example

This commit is contained in:
Chris 2014-06-12 12:19:22 +00:00
parent 2fb0088528
commit 0d16700511

View File

@ -2,6 +2,13 @@
require_once __DIR__."/../vendor/autoload.php"; require_once __DIR__."/../vendor/autoload.php";
/*
* This example will flash a led connected on pin 0 (GPIO17 on a Pi). If you are
* not on a Pi, please change (or remove) the mapper below and update the pin
* numbers to match.
*
*/
use NoccyLabs\Gpio\Gpio; use NoccyLabs\Gpio\Gpio;
use NoccyLabs\Gpio\GpioMapper\WiringPiMapper; use NoccyLabs\Gpio\GpioMapper\WiringPiMapper;
@ -23,6 +30,7 @@ $led = $gpio[0]
->setLabel("LED pin") ->setLabel("LED pin")
->setValue(0); ->setValue(0);
// Flash the led
$x = 0; $x = 0;
while(true) { while(true) {
$x = (int)(!$x); $x = (int)(!$x);