diff --git a/lib/gpio/source/Pin.php b/lib/gpio/source/Pin.php index 6e5fb4a..7403885 100755 --- a/lib/gpio/source/Pin.php +++ b/lib/gpio/source/Pin.php @@ -15,7 +15,7 @@ private $value; public function __construct($pin){ - if( !is_int($pin) ) + if( !preg_match('@^\d+$@', $pin) ) throw new Exception("pin must be an integer"); diff --git a/lib/gpio/source/high.php b/lib/gpio/source/high.php index 6f6790b..45e6fe1 100755 --- a/lib/gpio/source/high.php +++ b/lib/gpio/source/high.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->value = Pin::GPIO_HIGH; + return 0; + } diff --git a/lib/gpio/source/in.php b/lib/gpio/source/in.php index 4a74ccf..7dca599 100755 --- a/lib/gpio/source/in.php +++ b/lib/gpio/source/in.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->mode = Pin::GPIO_IN; + return 0; + } diff --git a/lib/gpio/source/low.php b/lib/gpio/source/low.php index 552bc91..3ab526d 100755 --- a/lib/gpio/source/low.php +++ b/lib/gpio/source/low.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->value = Pin::GPIO_LOW; + return 0; + } diff --git a/lib/gpio/source/out.php b/lib/gpio/source/out.php index 087bb2b..3909207 100755 --- a/lib/gpio/source/out.php +++ b/lib/gpio/source/out.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->mode = Pin::GPIO_OUT; + return 0; + }