tasoft / gpio-wrapper
dev-master
2019-08-30 11:12 UTC
Requires
- php: ^7.2
Requires (Dev)
- phpunit/phpunit: ^6
This package is auto-updated.
Last update: 2024-11-29 07:23:33 UTC
README
This library defines a php stream wrapper that allows you to access the gpio interface on your raspberry pi device.
Install
$ composer require tasoft/gpio-wrapper
Usage
\TASoft\GPIO\LiveGPIOWrapper::register(); // Now all commands are available using protocol gpio:// file_put_contents("gpio://export", 24); // Exports pin 24 and make it available here echo file_get_contents("gpio://gpio24/direction"); // in or out echo file_get_contents("gpio://gpio24/value"); // 1 or 0