Coder Social home page Coder Social logo

node-sensortag's Introduction

node-sensortag

node.js lib for the TI SensorTag

Install

npm install sensortag

Usage

var SensorTag = require('sensortag');

Discover

SensorTag.discover(callback(sensorTag)[, uuid]);

Optional SensorTag uuid to scan for, obtained from previous discover sensorTag.uuid. The uuid per SensorTag may not be the same across machines.

Connect

sensorTag.connect(callback);

Disconnect

sensorTag.disconnect(callback);

Discover Services and Characteristics

sensorTag.discoverServicesAndCharacteristics(callback);

Device Info

sensorTag.readDeviceName(callback(deviceName));

sensorTag.readSystemId(callback(systemId));

sensorTag.readSerialNumber(callback(serialNumber));

sensorTag.readFirmwareRevision(callback(firmwareRevision));

sensorTag.readHardwareRevision(callback(hardwareRevision));

sensorTag.readSoftwareRevision(callback(softwareRevision));

sensorTag.readManufacturerName(callback(manufacturerName));

IR Temperature Sensor

Enable/disable:

sensorTag.enableIrTemperature(callback);

sensorTag.disableIrTemperature(callback);

Read:

sensorTag.readIrTemperature(callback(objectTemperature, ambientTemperature));

Notify/Unnotify:

sensorTag.notifyIrTemperature(callback);

sensorTag.unnotifyIrTemperature(callback);

sensorTag.on('irTemperatureChange', callback(objectTemperature, ambientTemperature));

Accelerometer

Enable/disable/configure:

sensorTag.enableAccelerometer(callback);

sensorTag.disableAccelerometer(callback);

sensorTag.setAccelerometerPeriod(period, callback); // period 1 - 2550 ms, default period is 2000 ms

Read:

sensorTag.readAccelerometer(callback(x, y, z));

Notify/Unnotify:

sensorTag.notifyAccelerometer(callback);

sensorTag.unnotifyAccelerometer(callback);

sensorTag.on('accelerometerChange', callback(x, y, z));

Humidity Sensor

Enable/disable:

sensorTag.enableHumidity(callback);

sensorTag.disableHumidity(callback);

Read:

sensorTag.readHumidity(callback(temperature, humidity));

Notify/Unnotify:

sensorTag.notifyHumidity(callback);

sensorTag.unnotifyHumidity(callback);

sensorTag.on('humidityChange', callback(temperature, humidity));

Magnetometer

Enable/disable:

sensorTag.enableMagnetometer(callback);

sensorTag.disableMagnetometer(callback);

sensorTag.setMagnetometerPeriod(period, callback); // period 1 - 2550 ms, default period is 2000 ms

Read:

sensorTag.readMagnetometer(callback(x, y, z));

Notify/Unnotify:

sensorTag.notifyMagnetometer(callback);

sensorTag.unnotifyMagnetometer(callback);

sensorTag.on('magnetometerChange', callback(x, y, z));

Barometric Pressure Sensor

Enable/disable:

sensorTag.enableBarometricPressure(callback);

sensorTag.disableBarometricPressure(callback);

Read:

sensorTag.readBarometricPressure(callback(pressure));

Notify/Unnotify:

sensorTag.notifyBarometricPressure(callback);

sensorTag.unnotifyBarometricPressure(callback);

sensorTag.on('barometricPressureChange', callback(pressure));

Gyroscope

Enable/disable:

sensorTag.enableGyroscope(callback);

sensorTag.disableGyroscope(callback);

Read:

sensorTag.readGyroscope(callback(x, y, z));

Notify/Unnotify:

sensorTag.notifyGyroscope(callback);

sensorTag.unnotifyGyroscope(callback);

sensorTag.on('gyroscopeChange', callback(x, y, z));

Simple Key

Notify/Unnotify:

sensorTag.notifySimpleKey(callback);

sensorTag.unnotifySimpleKey(callback);

sensorTag.on('simpleKeyChange', callback(left, right));

node-sensortag's People

Contributors

bl4z avatar chrisrichards avatar hardillb avatar sandeepmistry avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.