rpi/pigpio

Library for the Raspberry Pi.

0.0.1 2020-11-07 15:05 UTC

This package is auto-updated.

Last update: 2024-04-07 22:35:19 UTC


README

PHP bindings to the pigpio C library.

Requirements

  • PHP >= 8.0
  • PHP FFI extension available
  • pigpio

Installation

    composer require rpi/pigpio

Example:

require __DIR__ . '/vendor/autoload.php';

use Serafim\FFILoader\Loader;
use Rpi\Pigpio\Library;

$loader = new Loader();
$ffi = $loader->load(new Library())->ffi;

$ffi->gpioInitialise();

$ffi->gpioWrite(14, 1);

$ffi->gpioTerminate();