New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

sensortag-shake

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sensortag-shake

Simple Shake Detector for the TI SensorTag

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

SensorTag-Shake

Simple shake detection library for the TI SensorTag based on the popular SensorTag package.

Install

npm install --save sensortag-shake

Usage

var SensorTagShake = require('sensortag-shake');

var sensortagshake = new SensorTagShake('+x');

sensortagshake.on('shake', function(data){
	console.log("Shook with ", data.value, "at", data.time);
});

API

Constructor

eg : var sensortagshake = new SensorTagShake(direction, {sensorTag : sensorTagObj});

  • direction: String - The direction of shake to detect. This is a string with sign (+,-) and a coordinate (x,y,z). For eg. '+x'.
  • options : Object - An options object with the folloing optional properties.
    • sensorTag : Object - A SensorTag object, which has already discovered and connected to a SensorTag hardware. This allows a SensorTag object to be used with multiple libraries. If this optional value is not specified, this constructor will re-discover and re-connect to the SensorTag.

Events

eg : sensortagshake.on('shake', function(data){}

  • The SensorTag object emits a shake event, which contains a data object as defined below.
  • data : Object - Has the following properties.
    • value : Number - Number indicating the final accelerometer value when the shake was detected.
    • time : Number - Timestamp (msec) of the detection of the shake. This has (based on the SensorTag HW) minimum granularity of 200msec.

Keywords

sensortag

FAQs

Package last updated on 03 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts