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-09-29 06:56:17 UTC
README
这个库定义了一个php流包装器,允许您访问树莓派设备上的GPIO接口。
安装
$ composer require tasoft/gpio-wrapper
用法
\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