#APDS Gesture control driver
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);
});