tasoft/gpio-wrapper

dev-master 2019-08-30 11:12 UTC

This package is auto-updated.

Last update: 2022-05-29 01:40:44 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