Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 152 | | All time: 9,063 This week: 560 |
|
Description | | Author |
This package can read values from RaspberryPI DS18B20 sensors.
It can read a Raspberry PI Linux system file that returns the list of a available sessions in a DS18B20 device.
The class can also read the values of each available sensor. Innovation Award
| |
|
|
Innovation award
Nominee: 4x
Winner: 1x |
|
Example
<?php
require_once __DIR__ . '/vendor/autoload.php';
use azolee\DS18B20;
$data = DS18B20::loadSensors();
header('Content-type: application/json');
echo json_encode( $data );
|
Details
A Simple DS18B20 Sensor Handling PHP Package
This package can be used to read the popular DS18B20 Sensor data from multiple sensors on a Raspberry PI.
Tested on Raspibian OS.
Note: Previously the Raspibian needs to be configured to handle the sensor.
Example usage (See _tests_ folder)
Read the raw data:
use azolee\DS18B20;
$respone = DS18B20::loadSensors();
var_dump($respone);
Read the raw data and process it:
use azolee\DS18B20;
use azolee\DataFormat\{CelsiusDataProcessor, FahrenheitDataProcessor};
//in Celsius
$celsiusDataProcessor = new CelsiusDataProcessor();
$celsiusDataProcessor->setPrecision(3);
$respone = DS18B20::loadSensors($celsiusDataProcessor);
var_dump($respone);
// in Fahrenheit
$fahrenheitDataProcessor = new FahrenheitDataProcessor();
$fahrenheitDataProcessor->setPrecision(0);
DS18B20::setProcessor($fahrenheitDataProcessor);
$respone = DS18B20::loadSensors();
var_dump($respone);
License: MIT
Author: ANDRAS Zoltan Gyarfas
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.