PHPackages                             tgeindre/php-gpio - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tgeindre/php-gpio

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tgeindre/php-gpio
=================

GPIO-related utils &amp; toolkit PHP library

v1.0.0(10y ago)21163MITPHPPHP &gt;=5.6.0

Since May 30Pushed 10y ago2 watchersCompare

[ Source](https://github.com/t-geindre/php-gpio)[ Packagist](https://packagist.org/packages/tgeindre/php-gpio)[ Docs](https://github.com/t-geindre/php-gpio)[ RSS](/packages/tgeindre-php-gpio/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

PHP-GPIO [![master build](https://camo.githubusercontent.com/131a5df8d02b28dfe09cf9e3af348a4b39f0124e609036fad58a06e82964aacb/68747470733a2f2f6170692e7472617669732d63692e6f72672f742d6765696e6472652f7068702d6770696f2e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/131a5df8d02b28dfe09cf9e3af348a4b39f0124e609036fad58a06e82964aacb/68747470733a2f2f6170692e7472617669732d63692e6f72672f742d6765696e6472652f7068702d6770696f2e7376673f6272616e63683d6d6173746572)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#php-gpio-)

A simple library to read/write Raspberry PI GPIOs with PHP.

Forked from [ronanguilloux/php-gpio](https://github.com/ronanguilloux/php-gpio) and tested with [Atoum](http://atoum.org/).

Install
-------

[](#install)

This library can be installed using [Composer](https://getcomposer.org/):

```
$ composer require tgeindre/php-gpio
```

Read/Write Raspberry Pi GPIOs
-----------------------------

[](#readwrite-raspberry-pi-gpios)

To read/write Raspberry Pi GPIOs, use the `PhpGpio\Gpio` class. The instanciation of this class requires an array of pins numbers you will use.

You can define a specific list of pins numbers, according to your usage and your Rasberry Pi version, or you can use the `PhpGpio\Utils\Pi` class to automaticly find all availables pins:

```
