此包的最新版本(v0.1.0)没有可用的许可证信息。

一个与简单API配合使用以控制Raspberry PI 3的GPIO的扩展,使用Wiring Pi库

v0.1.0 2019-03-21 21:21 UTC

This package is auto-updated.

Last update: 2024-09-22 10:06:01 UTC


README

PHP库,用于控制Raspberry 3的GPIO端口

要求

  • PHP >= 7.2.*

环境

在raspbian 9上与PHP 7.2进行了测试

安装

使用composer直接在命令行终端安装

composer require ioteducation/gpio

或在您的composer.json文件中添加

"require": {
    "ioteducation/gpio": "^0.1.0"
},

然后在终端中

composer update

示例

执行器

use I9IoT\GPIO\Device\Device;
use I9IoT\GPIO\Pin\PinMode;
use I9IoT\GPIO\Pin\PinState;

$device = new Device();
$device->newPin(26, PinMode::OUTPUT);

// Equivalente ao digitalWrite(26,HIGH) do arduino
$device->actions->digitalWrite(26, PinState::HIGH);

// Equivalente ao digitalWrite(26,LOW) do arduino
$device->actions->digitalWrite(26, PinState::LOW);

// Equivalente ao digitalRead(26) do arduino
echo $device->actions->digitalRead(26);

即将推出

  • 传感器
  • 中断
  • PWM
  • newPin的替代功能
    • newOutput
    • newInput
    • newPWM
    • newInterrupt
    • 以及其他

开发

该项目是IoT Education与I9 IoT的合作项目。

IoT Education

  • 城市:Indaiatuba - SP
  • 行业:物联网咨询和培训

I9 IoT(初创公司)

  • 城市:Indaiatuba - SP
  • 行业:物联网咨询和系统开发