https://github.com/alexeden/bno055-imu-node
Interface with a BNO-series IMU from your Node.js app over I2C
https://github.com/alexeden/bno055-imu-node
bno055 embedded imu imu-sensor nodejs raspberry-pi rpi typescript
Last synced: about 1 year ago
JSON representation
Interface with a BNO-series IMU from your Node.js app over I2C
- Host: GitHub
- URL: https://github.com/alexeden/bno055-imu-node
- Owner: alexeden
- Created: 2019-05-26T18:25:56.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T17:44:52.000Z (over 3 years ago)
- Last Synced: 2025-06-08T03:09:57.246Z (about 1 year ago)
- Topics: bno055, embedded, imu, imu-sensor, nodejs, raspberry-pi, rpi, typescript
- Language: TypeScript
- Homepage:
- Size: 2.32 MB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# BNO055 IMU + Node.js
## Install
```
npm install --save bno055-imu-node
```
## Usage
```ts
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](https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md) 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:
```jsonc
{
"username": "<<>>",
"hostname": "<<>>",
"directory": "<<>>",
"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`.