Skip to main content

Class Bmi270

Represents a BMI270 inertial measurement unit (IMU)

Assembly: Bmi270.dll
View Source
public class Bmi270 : PollingSensorBase<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, Temperature? Temperature)>, IObservable<IChangeResult<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, Temperature? Temperature)>>, ISamplingSensor<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, Temperature? Temperature)>, ISensor<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, Temperature? Temperature)>, II2cPeripheral, IGyroscope, ISamplingSensor<AngularVelocity3D>, ISensor<AngularVelocity3D>, IAccelerometer, ISamplingSensor<Acceleration3D>, ISensor<Acceleration3D>, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, ISensor, ISamplingSensor

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT> -> Meadow.Foundation.SamplingSensorBase<UNIT> -> Meadow.Foundation.PollingSensorBase<UNIT>

Implements:

Expand

System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,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.Temperature>>>, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.Temperature>>>, Meadow.Hardware.II2cPeripheral, Meadow.Peripherals.Sensors.Motion.IGyroscope, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.AngularVelocity3D>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.AngularVelocity3D>, Meadow.Peripherals.Sensors.Motion.IAccelerometer, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Acceleration3D>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Acceleration3D>, 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

Properties

Acceleration3D

Current Acceleration 3D

View Source
public Acceleration3D? Acceleration3D { get; }

AngularVelocity3D

Current Angular Velocity (Gyro) 3D

View Source
public AngularVelocity3D? AngularVelocity3D { get; }

Temperature

Current Temperature

View Source
public Temperature? Temperature { get; }

CurrentAccelerationRange

The range of values that can be read for acceleration on each axis

View Source
public Bmi270.AccelerationRange CurrentAccelerationRange { get; }

CurrentAngularVelocityRange

The range of values that can be read for angular acceleration (gyro) on each axis

View Source
public Bmi270.AngularVelocityRange CurrentAngularVelocityRange { get; }

DefaultI2cAddress

The default I2C address for the peripheral

View Source
public byte DefaultI2cAddress { get; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
protected readonly II2cCommunications i2cComms

Methods

SetAccelerationRange(AccelerationRange)

Set the range of values the sensor can read for acceleration

View Source
public void SetAccelerationRange(Bmi270.AccelerationRange accelRange)
Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Accelerometers.Bmi270.AccelerationRangeaccelRangeAccelerationRange

SetAngularVelocityRange(AngularVelocityRange)

Set the range of values the sensor can read for angular velocity (gyro)

View Source
public void SetAngularVelocityRange(Bmi270.AngularVelocityRange angRange)
Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Accelerometers.Bmi270.AngularVelocityRangeangRangeAngularAccelerationRange

RaiseEventsAndNotify(IChangeResult<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, Temperature? Temperature)>)

Raise events for subscribers and notify of value changes

View Source
protected override void RaiseEventsAndNotify(IChangeResult<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, Temperature? Temperature)> changeResult)
Parameters
TypeNameDescription
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.Temperature>>>changeResultThe updated sensor data

ReadSensor()

Reads data from the sensor

View Source
protected override Task<(Acceleration3D? Acceleration3D, AngularVelocity3D? AngularVelocity3D, Temperature? Temperature)> ReadSensor()
Returns

System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.Temperature>>>: The latest sensor reading### SetPowerMode(PowerMode) Set the device power mode

View Source
public void SetPowerMode(Bmi270.PowerMode powerMode)
Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Accelerometers.Bmi270.PowerModepowerModeThe power mode

Events

Acceleration3DUpdated

Event raised when linear acceleration changes

View Source
public event EventHandler<IChangeResult<Acceleration3D>> Acceleration3DUpdated
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.Acceleration3D>>

AngularVelocity3DUpdated

Event raised when angular velocity (gyro) changes

View Source
public event EventHandler<IChangeResult<AngularVelocity3D>> AngularVelocity3DUpdated
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.AngularVelocity3D>>

TemperatureUpdated

Event raised when temperature changes

View Source
public event EventHandler<IChangeResult<Temperature>> TemperatureUpdated
Event Type

System.EventHandler<Meadow.IChangeResult<Meadow.Units.Temperature>>

Implements

  • System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,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.Temperature>>>
  • Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Acceleration3D>,System.Nullable<Meadow.Units.AngularVelocity3D>,System.Nullable<Meadow.Units.Temperature>>>
  • Meadow.Hardware.II2cPeripheral
  • Meadow.Peripherals.Sensors.Motion.IGyroscope
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.AngularVelocity3D>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.AngularVelocity3D>
  • Meadow.Peripherals.Sensors.Motion.IAccelerometer
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Acceleration3D>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Acceleration3D>
  • 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