All Projects → allebb → gpio

allebb / gpio

Licence: GPL-3.0 license
A RaspberryPi GPIO library written in PHP.

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to gpio

Rpi gpio
Ruby conversion of RPi.GPIO Python module
Stars: ✭ 185 (+1056.25%)
Mutual labels:  rpi, gpio, raspberrypi
Gumcp
Web Control Panel for Raspberry Pi
Stars: ✭ 124 (+675%)
Mutual labels:  rpi, raspberrypi
Crankshaft
Crankshaft: A turnkey GNU/Linux solution that transforms a Raspberry Pi to an Android Auto head unit.
Stars: ✭ 1,703 (+10543.75%)
Mutual labels:  rpi, raspberrypi
Cattlepi
effortlessly boot, configure, update and monitor your raspberry pi ☁️
Stars: ✭ 250 (+1462.5%)
Mutual labels:  rpi, raspberrypi
Wifi Connect
Easy WiFi setup for Linux devices from your mobile phone or laptop
Stars: ✭ 883 (+5418.75%)
Mutual labels:  rpi, raspberrypi
Gassistpi
Google Assistant for Single Board Computers
Stars: ✭ 911 (+5593.75%)
Mutual labels:  rpi, raspberrypi
Mqtt Io
Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
Stars: ✭ 234 (+1362.5%)
Mutual labels:  rpi, gpio
diy-linux-guide
An LFS like guide for cross-bootstrapping a small system for the Raspberry Pi
Stars: ✭ 26 (+62.5%)
Mutual labels:  rpi, raspberrypi
ControlBlockService2
This is the driver for the ControlBlock re.v 2.X, a power switch and input/output/gameapd gadget for the Raspberry Pi
Stars: ✭ 18 (+12.5%)
Mutual labels:  rpi, raspberrypi
PiBeacon
Low-cost iBeacon using Raspberry Pi
Stars: ✭ 41 (+156.25%)
Mutual labels:  rpi, raspberrypi
vdcd
vdcd - virtual device controller daemon/framework for digitalSTROM
Stars: ✭ 19 (+18.75%)
Mutual labels:  rpi, gpio
Raspberrypipkg
DEPRECATED - DO NOT USE | Go here instead ->
Stars: ✭ 758 (+4637.5%)
Mutual labels:  rpi, raspberrypi
Rpi23 Gen Image
Advanced Debian "stretch" and "buster" bootstrap script for RPi 0/1/2/3 and QEMU
Stars: ✭ 300 (+1775%)
Mutual labels:  rpi, raspberrypi
Raspberrypi tempmon
Raspberry pi CPU temperature monitor with many functions such as logging, GPIO output, graphing, email, alarm, notifications and stress testing. Python 3.
Stars: ✭ 52 (+225%)
Mutual labels:  rpi, raspberrypi
Raspap Webgui
Simple wireless AP setup & management for Debian-based devices
Stars: ✭ 3,383 (+21043.75%)
Mutual labels:  rpi, raspberrypi
Linux-System-Info-Webpage
Material Design Dashboard for Linux System Info. Great for RPi and other linux Distros
Stars: ✭ 19 (+18.75%)
Mutual labels:  rpi, raspberrypi
Gpiozero
A simple interface to GPIO devices with Raspberry Pi
Stars: ✭ 1,302 (+8037.5%)
Mutual labels:  gpio, raspberrypi
wifi-connect
Easy WiFi setup for Linux devices from your mobile phone or laptop
Stars: ✭ 1,043 (+6418.75%)
Mutual labels:  rpi, raspberrypi
pihut-xmas-asyncio
Demonstration driving The Pi Hut Raspberry Pi 3D Xmas tree using Python Asyncio
Stars: ✭ 15 (-6.25%)
Mutual labels:  gpio, raspberrypi
52-Weeks-of-Pi
Inspired by Shekhar Gulati's "52 technologies in 2016", I've decided to set a goal of 52 Pi ideas over the next year.
Stars: ✭ 54 (+237.5%)
Mutual labels:  gpio, raspberrypi

GPIO

Build Code Coverage Scrutinizer Code Quality Code Climate Latest Stable Version Latest Unstable Version License

A RaspberryPi GPIO library written in PHP, This library makes it a breeze to work with simple inputs and outputs such as buttons, switches, LED's, motors and relays.

Requirements

  • PHP >= 7.3.0

This library is unit tested against PHP 7.3, 7.4, 8.0 and 8.1!

If you need to use an older version of PHP, you should instead install the 1.x version of this library (see below for details).

License

This library is released under the GPLv3 license, you are welcome to use it, improve it and contribute your changes back!

Installation

The recommended way of installing the latest version of this library is via. Composer; To install using Composer type the following command at the console:

composer require ballen/gpio

If you need to use an older version of PHP, version 1.x.x supports PHP 7.1 and 7.2, you can install this version using Composer with this command instead:

composer require ballen/gpio ^1.0

Example usage

An example of a flashing a single LED:

use Ballen\GPIO\GPIO;

// Create a new instane of the GPIO class.
$gpio = new GPIO();

// Configure our 'LED' output...
$led = $gpio->pin(18, GPIO::OUT);

// Create a basic loop that runs continuously...
while (true) {
    // Turn the LED on...
    $led->setValue(GPIO::HIGH);
    // Wait for one second...
    sleep(1);
    // Turn off the LED...
    $led->setValue(GPIO::LOW);
    // Wait for one second...
    sleep(1);
}

Tests and coverage

This library is fully unit tested using PHPUnit.

I use GitHub Actions for continuous integration, which triggers tests for PHP 7.3, 7.4, 8.0 and 8.1 every time a commit is pushed.

If you wish to run the tests yourself you should run the following:

# Install the GPIO Library (which will include PHPUnit as part of the require-dev dependencies)
composer install

# Now we run the unit tests (from the root of the project) like so:
./vendor/bin/phpunit

Code coverage can also be run and a report generated (this does require XDebug to be installed)...

./vendor/bin/phpunit --coverage-html ./report

Support

I am happy to provide support via. my personal email address, so if you need a hand drop me an email at: [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].