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
Showing
31 changed files
with
13,463 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
1,830 changes: 1,830 additions & 0 deletions
1,830
docs/mc-tempsensor/2.0.0/fonts/OpenSans-Bold-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
1,830 changes: 1,830 additions & 0 deletions
1,830
docs/mc-tempsensor/2.0.0/fonts/OpenSans-BoldItalic-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
1,830 changes: 1,830 additions & 0 deletions
1,830
docs/mc-tempsensor/2.0.0/fonts/OpenSans-Italic-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
1,831 changes: 1,831 additions & 0 deletions
1,831
docs/mc-tempsensor/2.0.0/fonts/OpenSans-Light-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
1,835 changes: 1,835 additions & 0 deletions
1,835
docs/mc-tempsensor/2.0.0/fonts/OpenSans-LightItalic-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
1,831 changes: 1,831 additions & 0 deletions
1,831
docs/mc-tempsensor/2.0.0/fonts/OpenSans-Regular-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,144 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>JSDoc: Home</title> | ||
|
||
<script src="scripts/prettify/prettify.js"> </script> | ||
<script src="scripts/prettify/lang-css.js"> </script> | ||
<!--[if lt IE 9]> | ||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> | ||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="main"> | ||
|
||
<h1 class="page-title">Home</h1> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>mc-tempsensor 2.0.0</h3> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<section> | ||
<article><p><a href="https://coveralls.io/github/Ozsie/mc-tempSensor?branch=master"><img src="https://coveralls.io/repos/github/Ozsie/mc-tempSensor/badge.svg?branch=master" alt="Coverage Status"></a> | ||
<a href="https://travis-ci.org/Ozsie/mc-tempSensor"><img src="https://travis-ci.org/Ozsie/mc-tempSensor.svg?branch=master" alt="Build Status"></a></p> | ||
<p><strong>NOTE: Version 2.0.0 breaks compatibility with version 1.x</strong></p> | ||
<p>A simple library for accessing a DS18B20 digital thermometer on a RaspberryPi</p> | ||
<p><strong><em>Installation</em></strong></p> | ||
<pre class="prettyprint source"><code>npm install mc-tempsensor</code></pre><p><strong><em>Settings</em></strong></p> | ||
<p>The default settings when initializing are:</p> | ||
<pre class="prettyprint source"><code>{ | ||
defaultPath: true, | ||
installKernelMod: false | ||
}</code></pre><p>When <code>defaultPath</code> is set to true, the expected input to init is just the sensor ID. If set to false, the full path is required.</p> | ||
<p><code>installKernelMod</code> can be set to true to automatically install the required kernel modules, w1-gpio and w1-therm.</p> | ||
<p><strong><em>Examples</em></strong></p> | ||
<p>This example assumes you have installed the necessary kernel modules, w1-gpio and w1-therm.</p> | ||
<pre class="prettyprint source"><code>var tempSensor = require('mc-tempsensor'); | ||
|
||
// 28-800000263717 is the ID of your DS18B20 thermometer which can be found in /sys/bus/w1/devices/ | ||
tempsensor.init('28-800000263717'); | ||
|
||
tempSensor.readAndParse(function(err, data) { | ||
if (err) { | ||
// Handle error | ||
} else { | ||
console.log('Temperature is ' + data[0].temperature.celcius + ' C'); | ||
} | ||
})</code></pre><p>If you for some reason need to specify the exact location of the temperature file:</p> | ||
<pre class="prettyprint source"><code>var tempSensor = require('mc-tempsensor'); | ||
|
||
// 28-800000263717 is the ID of your DS18B20 thermometer which can be found in /sys/bus/w1/devices/ | ||
tempsensor.init('/sys/bus/w1/devices/28-800000263717/w1-slave', {defaultPath: false, installKernelMod: false}); | ||
|
||
tempSensor.readAndParse(function(err, data) { | ||
if (err) { | ||
// Handle error | ||
} else { | ||
console.log('Temperature is ' + data[0].temperature.celcius + ' C'); | ||
} | ||
})</code></pre><p>Multiple temperature sources can be used:</p> | ||
<pre class="prettyprint source"><code>var tempSensor = require('mc-tempsensor'); | ||
|
||
// 28-800000263717 is the ID of your DS18B20 thermometer which can be found in /sys/bus/w1/devices/ | ||
tempsensor.init(['28-800000263717', '28-800000555555']); | ||
|
||
tempSensor.readAndParse(function(err, data) { | ||
if (err) { | ||
// Handle error | ||
} else { | ||
for (var i in data) { | ||
console.log('Temperature for sensor ' + i + ' is ' + data[i].temperature.celcius + ' C'); | ||
} | ||
} | ||
})</code></pre><p>A callback method can be used when initializing:</p> | ||
<pre class="prettyprint source"><code>var tempSensor = require('mc-tempsensor'); | ||
|
||
// 28-800000263717 is the ID of your DS18B20 thermometer which can be found in /sys/bus/w1/devices/ | ||
tempsensor.init(['28-800000263717', '28-800000555555'], undefined, function(err) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
});</code></pre><p>When using init without sensor input, all sensors in default location will be used:</p> | ||
<pre class="prettyprint source"><code>var tempSensor = require('mc-tempsensor'); | ||
|
||
tempsensor.init(undefined, undefined, function(err) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
});</code></pre><p><strong><em>Data format</em></strong></p> | ||
<pre class="prettyprint source"><code>[{ | ||
crc, | ||
available, | ||
temperature: { | ||
raw, | ||
celcius | ||
}, | ||
time | ||
}]</code></pre></article> | ||
</section> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</div> | ||
|
||
<nav> | ||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-mc-tempsensor.html">mc-tempsensor</a></li></ul> | ||
</nav> | ||
|
||
<br class="clear"> | ||
|
||
<footer> | ||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed May 31 2017 21:33:04 GMT+0200 (CEST) | ||
</footer> | ||
|
||
<script> prettyPrint(); </script> | ||
<script src="scripts/linenumber.js"> </script> | ||
</body> | ||
</html> |
Oops, something went wrong.