Skip to main content

Class Bmi270

Represents a BMI270 inertial measurement unit (IMU)

Assembly: Bmi270.dll
View Source
Declaration
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, ISleepAwarePeripheral

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.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, Meadow.ISleepAwarePeripheral

Properties

Acceleration3D

Current Acceleration 3D

View Source
Declaration
public Acceleration3D? Acceleration3D { get; }

AngularVelocity3D

Current Angular Velocity (Gyro) 3D

View Source
Declaration
public AngularVelocity3D? AngularVelocity3D { get; }

Temperature

Current Temperature

View Source
Declaration
public Temperature? Temperature { get; }

CurrentAccelerationRange

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

View Source
Declaration
public Bmi270.AccelerationRange CurrentAccelerationRange { get; }

CurrentAngularVelocityRange

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

View Source
Declaration
public Bmi270.AngularVelocityRange CurrentAngularVelocityRange { get; }

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
Declaration
protected readonly II2cCommunications i2cComms

Methods

SetAccelerationRange(AccelerationRange)

Set the range of values the sensor can read for acceleration

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

SetAngularVelocityRange(AngularVelocityRange)

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

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

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

Raise events for subscribers and notify of value changes

View Source
Declaration
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
Declaration
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
Declaration
public void SetPowerMode(Bmi270.PowerMode powerMode)
Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Motion.Bmi270.PowerModepowerModeThe power mode

BeforeSleep(CancellationToken)

Called before the platform goes into Sleep state

View Source
Declaration
public Task BeforeSleep(CancellationToken cancellationToken)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.CancellationTokencancellationToken

AfterWake(CancellationToken)

Called after the platform returns to Wake state

View Source
Declaration
public Task AfterWake(CancellationToken cancellationToken)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.CancellationTokencancellationToken

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
  • Meadow.ISleepAwarePeripheral