Ball Balancer Project
Public Member Functions | Public Attributes | List of all members
BNO055.BNO055 Class Reference

A BNO055 IMU driver class. More...

Public Member Functions

def __init__ (self, i2c)
 Initializes the BNO055 IMU
More...
 
def mode (self, modenum)
 Sets the mode for IMU at which it will be operating in. More...
 
def status (self)
 Identifies the calibration status of the IMU. More...
 
def read_coef (self)
 Reads the calibration coefficients when the system is fully calibrated. More...
 
def write_coef (self, cal_coefs)
 Writes existing calibration coefficients into the IMU
More...
 
def read_angle (self)
 Reads the euler angle data from IMU and merges MSB and LSB
More...
 
def read_omega (self)
 Reads the angular velocity data from IMU and merges MSB and LSB
More...
 

Public Attributes

 i2c
 
 addr
 
 cal_coef
 
 calbuff
 
 OPR_MODE
 
 config_mode
 
 NDoF_mode
 
 cal_byte
 
 mag_stat
 
 acc_stat
 
 gyr_stat
 
 sys_stat
 
 reg_addr
 
 Heading
 
 Roll
 
 Pitch
 
 w_y
 
 w_x
 
 w_z
 

Detailed Description

A BNO055 IMU driver class.

Objects of this class can be used to configure the BNO055 IMU. IMU objects created from this class are able be read data from the IMU using I2C. This includes calibration data, euler angles, and angular velocity.

Constructor & Destructor Documentation

◆ __init__()

def BNO055.BNO055.__init__ (   self,
  i2c 
)

Initializes the BNO055 IMU

Parameters
i2cThe I2C controller object that is associated with the IMU

Member Function Documentation

◆ mode()

def BNO055.BNO055.mode (   self,
  modenum 
)

Sets the mode for IMU at which it will be operating in.


Parameters
modenumwill be set to 0 for config mode and 1 for NDoF mode.

◆ read_angle()

def BNO055.BNO055.read_angle (   self)

Reads the euler angle data from IMU and merges MSB and LSB

Returns
(self.Roll, self.Pitch, self.Heading) Tuple of Euler Angles

◆ read_coef()

def BNO055.BNO055.read_coef (   self)

Reads the calibration coefficients when the system is fully calibrated.


Returns
self.cal_coef The calibration coefficients of the IMU.

◆ read_omega()

def BNO055.BNO055.read_omega (   self)

Reads the angular velocity data from IMU and merges MSB and LSB

Returns
(self.w_x,self.w_y,self.w_z) Tuple of angular velocity

◆ status()

def BNO055.BNO055.status (   self)

Identifies the calibration status of the IMU.

This function reads the calibration states from the IMU. It returns a 3 if the sensor is calibrated.

Returns
self.mag_stat Calibration status of magnetometer
self.acc_stat Calibration status of the accelerometer
self.gyr_stat Calibration status of the gyroscope
self.sys_stat Calibration statuse of the system

◆ write_coef()

def BNO055.BNO055.write_coef (   self,
  cal_coefs 
)

Writes existing calibration coefficients into the IMU

Parameters
cal_coefsThe calibration coefficients from previous calibrations

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