cleaned up gpio and device code, implemented dummy/dry run mode

This commit is contained in:
2014-06-19 12:27:31 +02:00
parent 3e4765d071
commit 1449ec643f
8 changed files with 481 additions and 84 deletions

24
examples/pcd8544.php Normal file
View File

@ -0,0 +1,24 @@
<?php
require_once __DIR__."/../vendor/autoload.php";
NoccyLabs\Crap\Crap::activate();
use NoccyLabs\Gpio\Gpio;
use NoccyLabs\Gpio\Device\Display\Pcd8544Device;
$gpio = new Gpio(true);
$lcd = new Pcd8544Device;
$lcd
// we can rename devices as we like, to help in debugging
->setName("pcd8544_1")
->setPin("sda", $gpio[0])
->setPin("scl", $gpio[1])
->setPin("res", $gpio[2])
->setPin("sce", $gpio[3])
->setPin("dc", $gpio[4])
->initialize()
;