npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sensortile-ble

v2.2.0

Published

npm package for interfacing with SensorTile boards using the Web Bluetooth API

Downloads

13

Readme

SensorTile Ble

SensorTile boards interface for browsers using the Web Bluetooth API.

Currently only tested with reactjs.

Links

Web Bluetooth Api: https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API

SensorTile evaluation board: https://www.st.com/en/evaluation-tools/steval-stlcs01v1.html

Npm package: https://www.npmjs.com/settings/reavershark/packages

Usage

See example.js for a full example.

Brief example

npm install sensortile-ble --save

In a reactjs file:

import Ble from "sensortile-ble";

ble.connect().then(() => {
  ble.setupSensors()
    .then((sensors) => {
      sensors.battery.read()
        .then((value) => {
          console.log('Battery percentage: ' + value.percentage);
        });
    });
});

Sensors

Accelerometer

Implementation: accelerometer.js

Properties:

  • read
    • value has properties:
      • timestamp
      • steps
        • number of steps since last reset
  • notify
    • triggers an event on the smallest movement
    • some events include the stepcount
      • the step count only increment with large movements
      • multiple events can have the same step count
    • some events include the motion
    • the event cannot have steps and motion at the same time
    • event.value has properties:
      • timestamp
      • steps (optional, mutually exclusive with motion)
        • number of steps since last reset
      • motion (optional, mutually exclusive with motion)
        • string array of motions performed (ex. ['Tilt', 'Single tap'])

Activity

Implementation: activity.js

Properties:

  • read
    • value has properties:
      • timestamp
      • activity
        • string representation of the current activity
        • possible values:
          • No activity, Stationary, Walking, Fast walking, Jogging, Biking, Driving
  • notify
    • triggers an event now and then
    • event.value has the same properties as read

Battery

Implementation: battery.js

Properties:

  • read

    • value has properties:
      • timestamp
      • percentage
        • battery percentage with 1 decimal (ex. 71.3)
      • voltage
        • battery voltage as a decimal in Volts
      • current
        • current being drawn from the battery in miliampere
        • negative values mean discharging, positive values mean charging
      • status
        • string representation of the current status
        • possible values:
        • Low battery, Discharging, Plugged not charging, Charging, Unknown
  • notify

    • triggers an event every ~0.5 seconds
    • event.value the same properties as read

Carry position

Implementation: carryPosition.js

Properties:

  • read
    • read needs notifications enabled (notifyEnable()) before reading
    • without notifications, position is always 'Unknown'
    • value has properties:
      • timestamp
      • position
        • string representation of the carry postion of the device
        • possible values:
          • Unknown, On desk, In hand, Near head, Shirt pocket, Trousers pocket, Arm swing
  • notify
    • triggers an event now and then
    • event.value has the same properties as read

Gesture

Implementation: gesture.js

Properties:

  • notify
    • triggers an event on every gesture performed
    • event.value has properties:
      • timestamp
      • gesture
        • string representation of the gesture performed of the device
        • possible values:
          • Unknown, Pick up, Glance, Wake up

Movement Fusion

Implementation: movementFusion.js

Properties:

  • notify
    • timestamp
    • acceleration
      • array with 3 elements: xyz
    • rotation
      • array with 3 elements: xyz
    • magnetic
      • array with 3 elements: xyz

Rotation (MEMS sensor fusion compact)

Implementation: rotation.js

Properties:

  • notify
    • timestamp
    • rotation
      • array of 3 elements with properties:
        • Qi
        • Qj
        • Qk
      • Each element represents a rotation 30 msecs after the previous

Sensor reverse-engineering

Unknown 1 (sketch)

UUID: 001d0000-0001-11e1-ac36-0002a5d5c51b

Properties:

  • read
    • timestamp (16)
    • 10 more bytes
  • notify
    • timestamp (16)
    • 10 more bytes

from python sdk:

...
0x00100000: feature_pressure.FeaturePressure,           #001d0000
0x00080000: feature_humidity.FeatureHumidity,           #001d0000
0x00040000: feature_temperature.FeatureTemperature,     #001d0000
#0x00020000: feature_battery.FeatureBattery,
0x00010000: feature_temperature.FeatureTemperature,     #001d0000
...

No idea