Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eiriksm/tessel-plops-logger
Logs the plops of a beer fermentation
https://github.com/eiriksm/tessel-plops-logger
Last synced: 12 days ago
JSON representation
Logs the plops of a beer fermentation
- Host: GitHub
- URL: https://github.com/eiriksm/tessel-plops-logger
- Owner: eiriksm
- Created: 2015-01-27T17:50:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-02-25T19:00:02.000Z (almost 6 years ago)
- Last Synced: 2024-12-12T09:40:31.788Z (17 days ago)
- Language: JavaScript
- Size: 925 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tessel-plops-logger
[![Greenkeeper badge](https://badges.greenkeeper.io/eiriksm/tessel-plops-logger.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/eiriksm/tessel-plops-logger.svg?branch=master)](https://travis-ci.org/eiriksm/tessel-plops-logger)
[![Coverage Status](http://img.shields.io/coveralls/eiriksm/tessel-plops-logger.svg)](https://coveralls.io/r/eiriksm/tessel-plops-logger?branch=master)
[![Code Climate](http://img.shields.io/codeclimate/github/eiriksm/tessel-plops-logger.svg)](https://codeclimate.com/github/eiriksm/tessel-plops-logger)
[![Dependency Status](https://david-dm.org/eiriksm/tessel-plops-logger.svg?theme=shields.io)](https://david-dm.org/eiriksm/tessel-plops-logger)Logs the plops of a beer fermentation. Like so.
![Plopping action](https://raw.github.com/eiriksm/tessel-plops-logger/master/plops.gif)
## Usage
```js
var tessel = require('tessel');
var ambientLib = require('ambient-attx4');
var ambient = ambientLib.use(tessel.port.B);var options = {
debug: true, // Whether or not to spit out all kinds of debug messages.
interval: 3, // Interval for sending data back (in s.)
ledNumber: 1, // The led number on the tessel to light up when sensing a plop.
level: 0.017, // The volume level to trigger the sound trigger.
maxLevel: 0.1, // The max volume level (higher sounds will be ignored).
plopCallback: function (err, data) {} // Callback that will be called on every plop.
};var tpl = require('tessel-plops-logger')(ambient, options, tessel);
var numberOfChecks = 0;// Function to call at every interval end.
function onIntervalEnd(err, plops) {
console.log('Plops per 3s at %s is %d', new Date(), plops);
numberOfChecks++;
if (numberOfChecks > 3) {
// This will stop the interval based checks.
tpl.stop();
}
}tpl.start(onIntervalEnd);