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

@workshop2/bno055-imu-node

v1.4.2

Published

Interact with a BNO055 IMU from your Node.js app

Downloads

5

Readme

npm version

BNO055 IMU + Node.js

Fork of bno055-imu-node but with ability to restore calibration/offset data.

Install

npm install --save @workshop2/bno055-imu-node

Usage

import {
  BNO055,
  // Enums:
  OpMode,
  DeviceAddress,
  PowerLevel,
} from 'bno055-imu-node';

// All BNO055 instance methods are async and return a promise
(async () => {
  // Start the sensor
  // The begin method performs basic connection verification and resets the device
  const imu = await BNO055.begin(
    DeviceAddress.A,    // Address enum: A = 0x28, B = 0x29
    OpMode.FullFusion   // Operation mode enum
  );

  // Get the sensors' calibration status
  const calibration = await imu.getCalibrationStatuses();

  // Check to see if the device is fully calibrated
  const isCalibrated = await imu.isFullyCalibrated();

  // Get information about the device's operational systems
  const systemStatus = await imu.getSystemStatus();
  const systemError = await imu.getSystemError();
  const selfTestResults = await imu.getSelfTestResults();
  const versions = await imu.getVersions();

  // Get the device's orientation as a quaternion object { x, y, z, w }
  const quat = await imu.getQuat();

  // Force the device to reset
  await imu.resetSystem();

  // Set the device power level (Normal, Low, or Suspend)
  await imu.setPowerLevel(PowerLevel.Normal);

  // Force the device to use an external clock source
  await imu.useExternalClock();

  // Verify that the device is connected (will throw an error if not)
  await imu.verifyConnection();
})();

Workflow

Make sure you have passwordless SSH access to your Raspberry Pi.

Clone/fork your repo onto both your local machine and your Raspberry Pi.

npm install inside the project on both your local machine and the remote device.

Create a file called sync.config.json on the machine on which you'll be developing, and substitute these values with your own:

{
  "username": "<<<username>>>",
  "hostname": "<<<hostname or IP address of your remote device>>>",
  "directory": "<<<parent directory on remote device into which the repo was cloned>>>",
  "quiet": false // Disable most rsync logs (defaults to false)
}

Locally, you can now run npm run sync-changes, and any changes made to files inside /src or /examples will automatically be uploaded to your Pi.

You can configure which excluded from uploaded by opening sync.js and modifying the exclude option passed to Rsync.build.

From the remote device, you can run npm run build-changes, and any changes pushed from your local machine will automatically be rebuilt. You can run additional scripts (test scripts, etc) by appending the shell commands to the exec property inside nodemon.build.json.