Package Data | |
---|---|
Maintainer Username: | khaledkhamis |
Maintainer Contact: | khaledkhamis@live.com (Khaled Khamis) |
Package Create Date: | 2016-04-25 |
Package Last Update: | 2016-04-27 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-12-15 03:01:15 |
Package Statistics | |
---|---|
Total Downloads: | 14 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
A laravel interface for Teleduino API
require the package using composer
composer require khaledkhamis/teleduino dev-master
add Teleduino service provider in providers
array in config/app.php
Khaledkhamis\Teleduino\TeleduinoServiceProvider::class,
Generate a key from teleduino.org
getValue()
to get a single value from the responsegetValues()
to get all values in the responsehasValues()
check whether there is a value to getgetRequestTime()
request time from the APIisSuccess()
1:success, 0:failedgetMessage()
returns the output message from the API<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
//use Teleduino namespace
use Khaledkhamis\Teleduino\Teleduino;
class ArduinoController extends Controller
{
public function setOutput()
{
$myArduino = new Teleduino('YOUR_API_KEY'); //default for 328
/*all functions accept same parameters as the API documentation
**https://www.teleduino.org/documentation/api/328-full
*/
$myArduino->definePinMode(4,1);
$myArduino->setDigitalOutput(4,2);
//a function with a return
$input = $myArduino->getDigitalInput(5)->getValue();
}
}
Feel free to fork and create a pull request!
For more information please get in touch: khaledkhamis@live.com