Class Bno055
Provide methods / properties to allow an application to control a BNO055 9-axis absolute orientation sensor.
Assembly: Bno055.dll
View Source
public class Bno055 : ByteCommsSensorBase<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, MagneticField3D? MagneticField3D, Quaternion? QuaternionOrientation, Acceleration3D? LinearAcceleration, Acceleration3D? GravityVector, EulerAngles? EulerOrientation, Temperature? Temperature)>, IObservable<IChangeResult<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, MagneticField3D? MagneticField3D, Quaternion? QuaternionOrientation, Acceleration3D? LinearAcceleration, Acceleration3D? GravityVector, EulerAngles? EulerOrientation, Temperature? Temperature)>>, ISamplingSensor<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, MagneticField3D? MagneticField3D, Quaternion? QuaternionOrientation, Acceleration3D? LinearAcceleration, Acceleration3D? GravityVector, EulerAngles? EulerOrientation, Temperature? Temperature)>, ISensor<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, MagneticField3D? MagneticField3D, Quaternion? QuaternionOrientation, Acceleration3D? LinearAcceleration, Acceleration3D? GravityVector, EulerAngles? EulerOrientation, Temperature? Temperature)>, IDisposable, IAccelerometer, ISamplingSensor<Acceleration3D>, ISensor<Acceleration3D>, IGyroscope, ISamplingSensor<AngularVelocity3D>, ISensor<AngularVelocity3D>, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, ISensor, ISamplingSensor, II2cPeripheral
Inheritance: System.Object
-> Meadow.Foundation.ObservableBase<UNIT>
Implements:
Expand
System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>>>
, Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>>
, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>>
, System.IDisposable
, Meadow.Peripherals.Sensors.Motion.IAccelerometer
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Acceleration3D>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Acceleration3D>
, Meadow.Peripherals.Sensors.Motion.IGyroscope
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.AngularVelocity3D>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.AngularVelocity3D>
, Meadow.Peripherals.Sensors.ITemperatureSensor
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
, Meadow.Peripherals.Sensors.ISensor
, Meadow.Peripherals.Sensors.ISamplingSensor
, Meadow.Hardware.II2cPeripheral
Properties
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
Acceleration3D
Current Acceleration
View Source
public Acceleration3D? Acceleration3D { get; }
AngularVelocity3D
Current Angular Velocity
View Source
public AngularVelocity3D? AngularVelocity3D { get; }
MagneticField3D
Current Magnetic Field
View Source
public MagneticField3D? MagneticField3D { get; }
QuaternionOrientation
Current Quaternion Orientation
View Source
public Quaternion? QuaternionOrientation { get; }
LinearAcceleration
Current Linear Acceleration
View Source
public Acceleration3D? LinearAcceleration { get; }
GravityVector
Current Gravity Vector
View Source
public Acceleration3D? GravityVector { get; }
EulerOrientation
Current Euler Orientation
View Source
public EulerAngles? EulerOrientation { get; }
Temperature
Current Temperature value
View Source
public Temperature? Temperature { get; }
TemperatureSource
Select the source of the Temperature property
View Source
public Bno055.Sensor TemperatureSource { get; set; }
PowerMode
Get or set the power mode for the sensor.
View Source
public byte PowerMode { get; set; }
OperatingMode
Get / set the current operating mode for the sensor.
View Source
public byte OperatingMode { get; set; }
IsInFusionMode
Check if sensor is currently working in Fusion mode.
View Source
public bool IsInFusionMode { get; }
IsSystemCalibrated
Get the system calibration status.
View Source
public bool IsSystemCalibrated { get; }
IsAccelerometerCalibrated
Get the accelerometer calibration status.
View Source
public bool IsAccelerometerCalibrated { get; }
IsGyroscopeCalibrated
Get the gyroscope calibration status.
View Source
public bool IsGyroscopeCalibrated { get; }
IsMagnetometerCalibrated
Get the magnetometer status.
View Source
public bool IsMagnetometerCalibrated { get; }
IsFullyCalibrated
Is the system fully calibrated?
View Source
public bool IsFullyCalibrated { get; }
Methods
StartUpdating(TimeSpan?)
Start updating
View Source
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | updateInterval | The time between updates |
StopUpdating()
Stop reading data
View Source
public override void StopUpdating()
ReadSensor()
Reads data from the sensor
View Source
protected override Task<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, MagneticField3D? MagneticField3D, Quaternion? QuaternionOrientation, Acceleration3D? LinearAcceleration, Acceleration3D? GravityVector, EulerAngles? EulerOrientation, Temperature? Temperature)> ReadSensor()
Returns
System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>>
: The latest sensor reading### RaiseEventsAndNotify(IChangeResult<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, MagneticField3D? MagneticField3D, Quaternion? QuaternionOrientation, Acceleration3D? LinearAcceleration, Acceleration3D? GravityVector, EulerAngles? EulerOrientation, Temperature? Temperature)>)
Raise events for subscribers and notify of value changes
View Source
protected override void RaiseEventsAndNotify(IChangeResult<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, MagneticField3D? MagneticField3D, Quaternion? QuaternionOrientation, Acceleration3D? LinearAcceleration, Acceleration3D? GravityVector, EulerAngles? EulerOrientation, Temperature? Temperature)> changeResult)
Parameters
Type | Name | Description |
---|---|---|
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>> | changeResult | The updated sensor data |
GetReadings(int, double)
Convert a section of the sensor data into a tuple
View Source
protected (double X, double Y, double Z) GetReadings(int start, double divisor)
Returns
System.ValueTuple<System.Double,System.Double,System.Double>
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start | Start of the data in the sensorReadings member variable |
System.Double | divisor | Divisor |
ConvertReadingToEulerAngles(int, double)
Convert the sensor readings into an orientation in Euler angles
View Source
protected EulerAngles ConvertReadingToEulerAngles(int start, double divisor)
Returns
Meadow.Foundation.Spatial.EulerAngles: EulerAngles object containing the orientation information
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start | First of the sensor readings to convert |
System.Double | divisor | Divisor to apply to the sensor data |
DisplayRegisters()
Read all of the registers and display their values on the Debug output.
View Source
public void DisplayRegisters()
Events
MagneticField3DUpdated
Raised when the magnetic field value changes
View Source
public event EventHandler<IChangeResult<MagneticField3D>> MagneticField3DUpdated
Event Type
System.EventHandler<Meadow.IChangeResult<Meadow.Units.MagneticField3D>>
QuaternionOrientationUpdated
Raised when the quaternion orientation value changes
View Source
public event EventHandler<IChangeResult<Quaternion>> QuaternionOrientationUpdated
Event Type
System.EventHandler<Meadow.IChangeResult<Meadow.Foundation.Spatial.Quaternion>>
LinearAccelerationUpdated
Raised when the linear acceleration value changes
View Source
public event EventHandler<IChangeResult<Acceleration3D>> LinearAccelerationUpdated
Event Type
System.EventHandler<Meadow.IChangeResult<Meadow.Units.Acceleration3D>>
GravityVectorUpdated
Raised when the gravity vector acceleration value changes
View Source
public event EventHandler<IChangeResult<Acceleration3D>> GravityVectorUpdated
Event Type
System.EventHandler<Meadow.IChangeResult<Meadow.Units.Acceleration3D>>
EulerOrientationUpdated
Raised when the euler orientation value changes
View Source
public event EventHandler<IChangeResult<EulerAngles>> EulerOrientationUpdated
Event Type
System.EventHandler<Meadow.IChangeResult<Meadow.Foundation.Spatial.EulerAngles>>
Implements
System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>>>
Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>>
Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Foundation.Spatial.Quaternion>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Foundation.Spatial.EulerAngles>,System.ValueTuple<System.Nullable<Meadow.Units.Temperature>>>>
System.IDisposable
Meadow.Peripherals.Sensors.Motion.IAccelerometer
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Acceleration3D>
Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Acceleration3D>
Meadow.Peripherals.Sensors.Motion.IGyroscope
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.AngularVelocity3D>
Meadow.Peripherals.Sensors.ISensor<Meadow.Units.AngularVelocity3D>
Meadow.Peripherals.Sensors.ITemperatureSensor
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
Meadow.Peripherals.Sensors.ISensor
Meadow.Peripherals.Sensors.ISamplingSensor
Meadow.Hardware.II2cPeripheral