Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 23bfa6037b393eea74ba99aef86c969dd2288b44 @ronanguilloux committed Nov 23, 2012
Showing with 135 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +19 −0 LICENSE
  3. +72 −0 README.md
  4. +21 −0 composer.json
  5. +17 −0 src/TemperaturePi/Logger.php
@@ -0,0 +1,6 @@
+vendor/
+composer.lock
+composer.phar
+phpunit.phar
+phpunit.xml
+php-cs-fixer.phar
19 LICENSE
@@ -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.
@@ -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
@@ -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/" }
+ }
+}
@@ -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();
+ }
+}

0 comments on commit 23bfa60

Please sign in to comment.