PHP Classes

iWire PHP Raspberry PI GPIO Class: Control a Raspberry PI board using GPIO

Recommend this page to a friend!
  Info   View files Example   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 172 All time: 8,784 This week: 139Up
Version License PHP version Categories
phpiwire 1.0.0Free For Educatio...5Hardware, Zephir


Andrew Collington


This package can control a Raspberry PI board using GPIO.

It is a PHP extension written in Zephir that interfaces with wiringPi to control a Raspberry Pi's GPIO and access values from pins of a board.

The package is able to read or write data from any pin available in each of the supported boards.

Innovation Award
PHP Programming Innovation award nominee
May 2018
Number 3
Raspberry PI is popular platform for tiny computer boards that can be purchased at a low cost and can run many types of software runs on a Linux based OS, including PHP.

This package is a PHP extension written in Zephir that can run on a Raspberry PI board to access values of pins that may be connected to external sensors.

Manuel Lemos
Picture of Andrew Collington
  Performance   Level  
Name: Andrew Collington <contact>
Classes: 16 packages by
Country: United Kingdom
Age: 49
All time rank: 574 in United Kingdom
Week rank: 568 Down19 in United Kingdom Down
Innovation award
Innovation award
Nominee: 3x



 * Phpiwire: A PHP wrapper for wiringPi
 * Checking pin status
 * @author Andrew Collington,
 * @version 0.2.0
 * @link
 * @license MIT,

namespace Phpiwire;

$pi = new Board();
$p = $pi->getPin(0)->mode(Pin::OUTPUT);

$p, "\n";

if (
$p->read() == Pin::LOW) {
"Setting {$p->getId()} to HIGH\n\n";
} else {
"Setting {$p->getId()} to LOW\n\n";

$p, "\n";

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file pin.php Example Example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,784
This week:139Up