Skip to content

jiahuang/apds-gesture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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);
});

About

JS driver for the APDS-9960 gesture sensor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published