-
-
28 Apr 2022 14:31:22 UTC
- Distribution: Device-Chip-BNO055
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (112 / 20 / 17)
- Kwalitee
Bus factor: 1- 85.76% Coverage
- License: perl_5
- Perl: v5.26.0
- Activity
24 month- Tools
- Download (15.59KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Data::Bitfield
- Device::Chip::Base::RegisteredI2C
- Future::AsyncAwait
- Object::Pad
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Device::Chip::BNO055
- chip driver for BNO055SYNOPSIS
use Device::Chip::BNO055; use Future::AsyncAwait; my $chip = Device::Chip::BNO055->new; await $chip->mount( Device::Chip::Adapter::...->new );
DESCRIPTION
This Device::Chip subclass provides specific communications to a Bosch BNO055 orientation sensor chip.
The reader is presumed to be familiar with the general operation of this chip; the documentation here will not attempt to explain or define chip-specific concepts or features, only the use of this module to access them.
METHODS
The following methods documented in an
await
expression return Future instances.read_ids
$ids = await $chip->read_ids;
Returns an 8-character string composed of the four ID registers. For a
BNO055
chip this should be the string"A0FB320F"
read_config
$config = await $chip->read_config;
Returns the current chip configuration.
change_config
await $chip->change_config( %changes );
Changes the configuration. Any field names not mentioned will be preserved at their existing values.
This method can only be used while the chip is in config mode, and cannot itself be used to set
OPR_MODE
. For that, use "set_opr_mode".set_opr_mode
await $chip->set_opr_mode( $mode );
Sets the
OPR_MODE
register.read_accelerometer_raw
( $x, $y, $z ) = await $chip->read_accelerometer_raw;
Returns the most recent accelerometer readings in raw 16bit signed integers
read_accelerometer
( $x, $y, $z ) = await $chip->read_accelerometer;
Returns the most recent accelerometer readings in converted units, either
m/s²
orG
depending on the chip'sACC_Unit
configuration.read_magnetometer_raw
( $x, $y, $z ) = await $chip->read_magnetometer_raw;
Returns the most recent magnetometer readings in raw 16bit signed integers
read_magnetometer
( $x, $y, $z ) = await $chip->read_magnetometer;
Returns the most recent magnetometer readings in converted units of
µT
.read_gyroscope_raw
( $x, $y, $z ) = await $chip->read_gyroscope_raw;
Returns the most recent gyroscope readings in raw 16bit signed integers
read_gyroscope
( $x, $y, $z ) = await $chip->read_gyroscope;
Returns the most recent gyroscope readings in converted units, either
dps
orrps
depending on the chip'sGYR_Unit
configuration.read_euler_angles
( $heading, $roll, $pitch ) = await $chip->read_euler_angles;
Returns the most recent Euler angle fusion readings in converted units, either degrees or radians depending on the chip's
EUL_units
configuration.read_quarternion
( $w, $x, $y, $z ) = await $chip->read_quarternion;
Returns the most recent quarternion fusion readings in converted units as scaled numbers between -1 and 1.
read_linear_acceleration
( $x, $y, $z ) = await $chip->read_linear_acceleration;
Returns the most recent linear acceleration fusion readings in converted units, either
m/s²
orG
depending on the chip'sACC_units
configuration.read_linear_acceleration
( $x, $y, $z ) = await $chip->read_linear_acceleration;
Returns the most recent gravity fusion readings in converted units, either
m/s²
orG
depending on the chip'sACC_units
configuration.AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
Module Install Instructions
To install Device::Chip::BNO055, copy and paste the appropriate command in to your terminal.
cpanm Device::Chip::BNO055
perl -MCPAN -e shell install Device::Chip::BNO055
For more information on module installation, please visit the detailed CPAN module installation guide.