PHP Classes

File: example/pin.php

Recommend this page to a friend!
  Classes of Andrew Collington  >  iWire PHP Raspberry PI GPIO Class  >  example/pin.php  >  Download  
File: example/pin.php
Role: Example script
Content type: text/plain
Description: Example script
Class: iWire PHP Raspberry PI GPIO Class
Control a Raspberry PI board using GPIO
Author: By
Last change:
Date: 4 years ago
Size: 542 bytes


Class file image Download

 * 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";

For more information send a message to info at phpclasses dot org.