PHPackages                             dept-of-scrapyard-robotics/generic-buttons - 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. [Framework](/categories/framework)
4. /
5. dept-of-scrapyard-robotics/generic-buttons

ActiveLibrary[Framework](/categories/framework)

dept-of-scrapyard-robotics/generic-buttons
==========================================

Drive generic GPIO buttons with Fabricate

0.5.0.x-dev(1mo ago)00MITPHPPHP ^8.3

Since Jul 12Pushed 1mo agoCompare

[ Source](https://github.com/DeptOfScrapyardRobotics/GenericButtons)[ Packagist](https://packagist.org/packages/dept-of-scrapyard-robotics/generic-buttons)[ Docs](https://dosr.projectsaturnstudios.com)[ RSS](/packages/dept-of-scrapyard-robotics-generic-buttons/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Generic Buttons
===============

[](#generic-buttons)

### Basic on/off GPIO buttons with PHP

[](#basic-onoff-gpio-buttons-with-php)

PHP package for simple digital buttons (momentary switches to GND or VCC). It sits on the ScrapyardIO GPIO stack and plugs into the BareMetal HumanInput components (`BasicButton`, `DigitalButtonPad`).

Compatible Digital Interfaces
=============================

[](#compatible-digital-interfaces)

Buttons are read from a digital input pin. Most switches to ground need an internal pull-up.

You can interface with them the following ways:

- A Linux single-board computer's exposed GPIO pins using the POSIX / libgpiod carrier (`posix`) with `LineBias::PULL_UP`
- An MPSSE-enabled USB-to-serial device such as an FT232H using the USB carrier (`usb`)

Dependencies
============

[](#dependencies)

This package makes use of modules within:

- [The ScrapyardIO Framework](https://github.com/ScrapyardIO/framework)

For GPIO buttons you also need:

- [POSI Extension v^0.4.0 or newer](https://github.com/php-io-extensions/posi)
- [Microscrap POSIX Drivers](https://github.com/microscrap/scrapyard-posix-drivers) (`posix` carrier)

Installing from Composer
========================

[](#installing-from-composer)

```
composer require dept-of-scrapyard-robotics/generic-buttons
```

Basic Usage
===========

[](#basic-usage)

### Active-low button with pull-up (POSIX)

[](#active-low-button-with-pull-up-posix)

```
