Example #1
0
<?php

require_once "../app/GPIO.php";
use App\GPIO;
$gpio = new GPIO("P9_12", GPIO::OUTPUT, GPIO::PUD_OFF, 0);
sleep(1);
$value = 1;
while (true) {
    $gpio->output($value);
    $value = $value ^ 1;
    sleep(5);
}
Example #2
0
 /**
  * Set the relay to OFF.
  * 
  * @return true|string True if successful or an error string.
  */
 public function off()
 {
     $this->state = self::OFF;
     return $this->gpio->output(self::OFF);
 }