ronanguilloux / php-gpio

A PHP library to play with the Raspberry PI's GPIO pins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a read-the-gpio-value function

ronanguilloux opened this issue · comments

/**
 * Read pin value.
 * 
 * @param int, $pinNo
 * @return bool|string
  */
 public function readValuePin($pinNo) {
     if (!$this->isValidPin($pinNo)) {
         return false;
     }

     return trim(file_get_contents(GpioInterface::PATH_GPIO.$pinNo.'/value'));
}

in this way?