Adafruit BNO08x Library
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Adafruit_BNO08x Class Reference

Class that stores state and functions for interacting with the BNO08x 9-DOF Orientation IMU Fusion Breakout. More...

#include <Adafruit_BNO08x.h>

Public Member Functions

 Adafruit_BNO08x (int8_t reset_pin=-1)
 Construct a new Adafruit_BNO08x::Adafruit_BNO08x object. More...
 
 ~Adafruit_BNO08x ()
 Destroy the Adafruit_BNO08x::Adafruit_BNO08x object.
 
bool begin_I2C (uint8_t i2c_addr=BNO08x_I2CADDR_DEFAULT, TwoWire *wire=&Wire, int32_t sensor_id=0)
 Sets up the hardware and initializes I2C. More...
 
bool begin_UART (HardwareSerial *serial, int32_t sensor_id=0)
 Sets up the hardware and initializes UART. More...
 
bool begin_SPI (uint8_t cs_pin, uint8_t int_pin, SPIClass *theSPI=&SPI, int32_t sensor_id=0)
 Sets up the hardware and initializes hardware SPI. More...
 
void hardwareReset (void)
 Reset the device using the Reset pin.
 
bool wasReset (void)
 Check if a reset has occured. More...
 
bool enableReport (sh2_SensorId_t sensor, uint32_t interval_us=10000)
 Enable the given report type. More...
 
bool getSensorEvent (sh2_SensorValue_t *value)
 Fill the given sensor value object with a new report. More...
 

Public Attributes

sh2_ProductIds_t prodIds
 The product IDs returned by the sensor.
 

Protected Member Functions

virtual bool _init (int32_t sensor_id)
 Initializer for post i2c/spi init. More...
 

Protected Attributes

sh2_Hal_t _HAL
 The struct representing the SH2 Hardware Abstraction Layer.
 

Detailed Description

Class that stores state and functions for interacting with the BNO08x 9-DOF Orientation IMU Fusion Breakout.

Constructor & Destructor Documentation

◆ Adafruit_BNO08x()

Adafruit_BNO08x::Adafruit_BNO08x ( int8_t  reset_pin = -1)

Construct a new Adafruit_BNO08x::Adafruit_BNO08x object.

Construct a new Adafruit_BNO08x::Adafruit_BNO08x object

Parameters
reset_pinThe arduino pin # connected to the BNO Reset pin

Member Function Documentation

◆ begin_I2C()

bool Adafruit_BNO08x::begin_I2C ( uint8_t  i2c_address = BNO08x_I2CADDR_DEFAULT,
TwoWire *  wire = &Wire,
int32_t  sensor_id = 0 
)

Sets up the hardware and initializes I2C.

Parameters
i2c_addressThe I2C address to be used.
wireThe Wire object to be used for I2C connections.
sensor_idThe unique ID to differentiate the sensors from others
Returns
True if initialization was successful, otherwise false.

◆ begin_UART()

bool Adafruit_BNO08x::begin_UART ( HardwareSerial *  serial,
int32_t  sensor_id = 0 
)

Sets up the hardware and initializes UART.

Parameters
serialPointer to Stream (HardwareSerial/SoftwareSerial) interface
sensor_idThe user-defined ID to differentiate different sensors
Returns
true if initialization was successful, otherwise false.

◆ begin_SPI()

bool Adafruit_BNO08x::begin_SPI ( uint8_t  cs_pin,
uint8_t  int_pin,
SPIClass *  theSPI = &SPI,
int32_t  sensor_id = 0 
)

Sets up the hardware and initializes hardware SPI.

Parameters
cs_pinThe arduino pin # connected to chip select
int_pinThe arduino pin # connected to BNO08x INT
theSPIThe SPI object to be used for SPI connections.
sensor_idThe user-defined ID to differentiate different sensors
Returns
true if initialization was successful, otherwise false.

◆ wasReset()

bool Adafruit_BNO08x::wasReset ( void  )

Check if a reset has occured.

Returns
true: a reset has occured false: no reset has occoured

◆ enableReport()

bool Adafruit_BNO08x::enableReport ( sh2_SensorId_t  sensorId,
uint32_t  interval_us = 10000 
)

Enable the given report type.

Parameters
sensorIdThe report ID to enable
interval_usThe update interval for reports to be generated, in microseconds
Returns
true: success false: failure

◆ getSensorEvent()

bool Adafruit_BNO08x::getSensorEvent ( sh2_SensorValue_t *  value)

Fill the given sensor value object with a new report.

Parameters
valuePointer to an sh2_SensorValue_t struct to fil
Returns
true: The report object was filled with a new report
false: No new report available to fill

◆ _init()

bool Adafruit_BNO08x::_init ( int32_t  sensor_id)
protectedvirtual

Initializer for post i2c/spi init.

Parameters
sensor_idOptional unique ID for the sensor set
Returns
True if chip identified and initialized

The documentation for this class was generated from the following files: