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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vliegwerk/arduino-nano-33-ble

v1.0.1

Published

Node.js interface for the Arduino Nano 33 BLE and Nano 33 BLE Sense

Downloads

3

Readme

node-arduino-nano-33-ble

Node.js interface for the Arduino Nano 33 BLE and Nano 33 BLE Sense microcontroller board.

What does this library do?

This library makes it easy to listen to data from one or more sensors on a Arduino Nano 33 BLE and Nano 33 BLE Sense. The library utilizes the on-board Bluetooth Low Energy connectivity.

Supported inertial measurement unit (IMU) sensors found on both the Nano 33 BLE and Nano 33 BLE Sense:

  • Accelerometer
  • Gyroscope
  • Magnetometer

Supported sensors found on the Nano 33 BLE Sense only:

  • Digital microphone
  • Temperature
  • Relative humidity
  • Pressure
  • Gesture sensor
  • Ambient light
  • Color
  • Proximity

The library provides the following filters and algorithms:

Prerequisites

This module requires an Arduino Nano 33 BLE or Nano 33 BLE Sense microcontroller board running the Arduino Nano33BLEService sketch.

Installation

npm install @vliegwerk/arduino-nano-33-ble --save

Basic usage

The following code can be used to start listening to sensor data received from your microcontroller:

const Nano33BLE = require('@vliegwerk/arduino-nano-33-ble')
const nano33ble = new Nano33BLE()

nano33ble.connect().then(connected => {
	if (!connected) {
		console.log('Unable to connect to Nano 33 BLE service')
	}
})

nano33ble.on('connected', id => {
	console.log(`Connected to ${id}`)

	nano33ble.on('accelerometer', data => {
		console.log('Accelerometer:', data)
	})

	nano33ble.on('gyroscope', data => {
		console.log('Gyroscope:', data)
	})

	nano33ble.on('magnetometer', data => {
		console.log('Magnetometer:', data)
	})
})

nano33ble.on('error', err => {
	console.error(err.message)
})

nano33ble.on('disconnected', id => {
	console.log(`Disconnected from ${id}`)
})

This will output the following in the console:

Connected to c5-29-67-c0-36-ca
Accelerometer: { x: -0.431396484375, y: 0.816650390625, z: 0.302490234375 }
Gyroscope: { x: 2.99072265625, y: 2.99072265625, z: 1.953125 }
Magnetometer: { x: -7.03125, y: -18.29833984375, z: -37.65869140625 }
Accelerometer: { x: -0.439208984375, y: 0.802001953125, z: 0.3203125 }
Gyroscope: { x: -2.5634765625, y: 0.1220703125, z: -1.708984375 }
Magnetometer: { x: -6.982421875, y: -19.3603515625, z: -37.2802734375 }
..

For more examples, see the examples folder in the node-arduino-nano-33-ble repository on GitHub.

Extras

  • The bluetooth connectivity implementation of this library is based on the Web Dashboard example in the Arduino and AI repository by Arduino.
  • See the License file for license rights and limitations (GPL).
  • Pull Requests are welcome!