예제 #1
0
 private function start()
 {
     if ($this->isActive()) {
         $this->stop();
     }
     $this->timer = $this->board->getLoop()->addPeriodicTimer($this->poll_interval, [$this, 'checkStatusRegisters']);
 }
예제 #2
0
 public function __construct(Board $board)
 {
     $this->board = $board;
     $this->pins = [];
     $this->observer = new Observer($board->getLoop());
     $this->observer->on(Observer::EVENT_MODIFY, [$this, 'eventDetect']);
     $this->observer->watch(sprintf('%s/gpio*/value', SysFS::PATH_BASE));
 }