Device::Chip::BNO055 - chip driver for BNO055
Device::Chip::BNO055
use Device::Chip::BNO055; use Future::AsyncAwait; my $chip = Device::Chip::BNO055->new; await $chip->mount( Device::Chip::Adapter::...->new );
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.
The following methods documented in an await expression return Future instances.
await
$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
BNO055
"A0FB320F"
$config = await $chip->read_config;
Returns the current chip configuration.
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".
OPR_MODE
await $chip->set_opr_mode( $mode );
Sets the OPR_MODE register.
( $x, $y, $z ) = await $chip->read_accelerometer_raw;
Returns the most recent accelerometer readings in raw 16bit signed integers
( $x, $y, $z ) = await $chip->read_accelerometer;
Returns the most recent accelerometer readings in converted units, either m/s² or G depending on the chip's ACC_Unit configuration.
m/s²
G
ACC_Unit
( $x, $y, $z ) = await $chip->read_magnetometer_raw;
Returns the most recent magnetometer readings in raw 16bit signed integers
( $x, $y, $z ) = await $chip->read_magnetometer;
Returns the most recent magnetometer readings in converted units of µT.
µT
( $x, $y, $z ) = await $chip->read_gyroscope_raw;
Returns the most recent gyroscope readings in raw 16bit signed integers
( $x, $y, $z ) = await $chip->read_gyroscope;
Returns the most recent gyroscope readings in converted units, either dps or rps depending on the chip's GYR_Unit configuration.
dps
rps
GYR_Unit
( $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.
EUL_units
( $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.
( $x, $y, $z ) = await $chip->read_linear_acceleration;
Returns the most recent linear acceleration fusion readings in converted units, either m/s² or G depending on the chip's ACC_units configuration.
ACC_units
Returns the most recent gravity fusion readings in converted units, either m/s² or G depending on the chip's ACC_units configuration.
Paul Evans <leonerd@leonerd.org.uk>
To install Device::Chip::BNO055, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Chip::BNO055
CPAN shell
perl -MCPAN -e shell install Device::Chip::BNO055
For more information on module installation, please visit the detailed CPAN module installation guide.