private function start() { if ($this->isActive()) { $this->stop(); } $this->timer = $this->board->getLoop()->addPeriodicTimer($this->poll_interval, [$this, 'checkStatusRegisters']); }
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)); }