JS driver for the APDS-9960 gesture sensor
JavaScript
Latest commit d66ef61 Feb 5, 2015 @jiahuang bump package.json
Permalink
Failed to load latest commit information.
example
README.md
index.js
package.json

README.md

APDS Gesture control driver

demo

Uses the Sparkfun Gesture sensor and a Tessel DIY module.

Physical hookup is this:

Gesture Sensor DIY Module
3.3V 3.3V
GND GND
SDA SDA
SCL SCL
INT GPIO 1 (G1)

Usage

Install with npm install apds-gesture

Example usage:

// example for the apds gesture sensor
var tessel = require('tessel');
var GestureLib = require('apds-gesture');
var G_THRESHOLD = 15
  , G_SENSITIVITY = 0.5//0.5
  ;

var gesture = GestureLib.use(tessel.port['A'], 
    {'threshold': G_THRESHOLD, 'sensitivity': G_SENSITIVITY});

gesture.debug = true;

gesture.on('ready', function(){
  console.log("found a gesture sensor");
  gesture.setup(function(){
     gesture.readGesture();
  });
});

gesture.on('movement', function(dir){
  console.log("Sensed movement", dir);
});

gesture.on('error', function (err){
  console.log("Error: ", err);
});