Example #1
0
 public function __construct(Board $board)
 {
     $this->board = $board;
     $this->pins = [];
     $this->gpio_register = $board->getGPIORegister();
     $this->poll_interval = self::DEFAULT_POLL_INTERVAL;
 }
Example #2
0
 public function __construct(Board $board, $pin_number)
 {
     $this->board = $board;
     $this->gpio_register = $board->getGPIORegister();
     $this->pin_number = $pin_number;
     //This needs to be done since it could be in any state, and the user would never know.
     //Without this could lead to unpredictable behaviour.
     //$this->setPull(self::PULL_NONE); //Maybe it should be up tot he user after all.
     //Set internal level
     $this->getLevel();
     //Set internal function
     $this->getFunction();
 }