Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 23bfa60
Showing
5 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
vendor/ | ||
composer.lock | ||
composer.phar | ||
phpunit.phar | ||
phpunit.xml | ||
php-cs-fixer.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (C) 2012 Ronan Guilloux | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
temperature-pi | ||
============== | ||
|
||
**temperature-pi** is a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite database. | ||
It's based on the [php-gpio](https://github.com/ronanguilloux/php-gpio) PHP library | ||
|
||
[![Build Status](https://secure.travis-ci.org/ronanguilloux/temperature-pi.png?branch=master)](http://travis-ci.org/ronanguilloux/temperature-pi) | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
The recommended way to install temperature-pi is through [composer](http://getcomposer.org). | ||
|
||
Just create a `composer.json` file for your project: | ||
|
||
``` json | ||
{ | ||
"require": { | ||
"php": ">=5.3.0", | ||
"ronanguilloux/temperature-pi": "master-dev" | ||
} | ||
} | ||
``` | ||
|
||
And run these two commands to install it: | ||
|
||
``` bash | ||
$ wget http://getcomposer.org/composer.phar | ||
$ php composer.phar install | ||
``` | ||
|
||
Now you can add the autoloader, and you will have access to the library: | ||
|
||
``` php | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
``` | ||
|
||
If you don't use neither **Composer** nor a _ClassLoader_ in your application, just require the provided autoloader: | ||
|
||
``` php | ||
<?php | ||
|
||
require_once 'src/autoload.php'; | ||
``` | ||
|
||
|
||
Usage | ||
----- | ||
|
||
``` php | ||
<?php | ||
require 'vendor/autoload.php'; | ||
$sensor = new PhpGpio\Sensors\DS18B20(); | ||
$currentTemperature = sensor->read(); | ||
``` | ||
|
||
|
||
Credits | ||
------- | ||
|
||
* Ronan Guilloux <ronan.guilloux@gmail.com> | ||
* [All contributors](https://github.com/ronanguilloux/temperature-pi/contributors) | ||
|
||
|
||
License | ||
------- | ||
|
||
**temperature-pi** is released under the MIT License. See the bundled LICENSE file for details. | ||
You can find a copy of this software here: https://github.com/ronanguilloux/temperature-pi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "ronanguilloux/temperature-pi", | ||
"type": "application to be run as a daemon", | ||
"description": "Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor", | ||
"keywords": ["temperature", "logger", "DS18B20", "sensors", "raspberry", "raspberry pi"], | ||
"homepage": "https://github.com/ronanguilloux/temperature-pi", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Ronan Guilloux", | ||
"email": "ronan.guilloux@gmail.com" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.3.0", | ||
"ronanguilloux/php-gpio": "master-dev" | ||
}, | ||
"autoload": { | ||
"psr-0": { "TemperaturePi": "src/" } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace TemperaturePi; | ||
|
||
use PhpGpio\Sensors\DS18B20(); | ||
|
||
class Logger | ||
{ | ||
private $sensor; | ||
private $currentTemperature; | ||
|
||
public function __construct() | ||
{ | ||
$this->sensor = new DS18B20(); | ||
$this->currentTemperature = sensor->read(); | ||
} | ||
} |