Skip to main content

Class Mag3110

Represents the Xtrinsic MAG3110 Three-Axis, Digital Magnetometer

Assembly: MAG3110.dll
View Source
Declaration
public class Mag3110 : ByteCommsSensorBase<(MagneticField3D? MagneticField3D, Temperature? Temperature)>, IObservable<IChangeResult<(MagneticField3D? MagneticField3D, Temperature? Temperature)>>, ISamplingSensor<(MagneticField3D? MagneticField3D, Temperature? Temperature)>, ISensor<(MagneticField3D? MagneticField3D, Temperature? Temperature)>, IDisposable, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, IMagnetometer, ISamplingSensor<MagneticField3D>, ISensor<MagneticField3D>, ISensor, ISamplingSensor, II2cPeripheral

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

Implements:

Expand

System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Units.Temperature>>>>, Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Units.Temperature>>>, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Units.Temperature>>>, System.IDisposable, Meadow.Peripherals.Sensors.ITemperatureSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.Motion.IMagnetometer, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.MagneticField3D>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.MagneticField3D>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

MagneticField3D

The current magnetic field value

View Source
Declaration
public MagneticField3D? MagneticField3D { get; }

Temperature

Current temperature of the die

View Source
Declaration
public Temperature? Temperature { get; }

Standby

Change or get the standby status of the sensor

View Source
Declaration
public bool Standby { get; set; }

IsDataReady

Indicate if there is any data ready for reading (x, y or z).

View Source
Declaration
public bool IsDataReady { get; }

DigitalInputsEnabled

Enable or disable interrupts.

View Source
Declaration
public bool DigitalInputsEnabled { get; set; }

Fields

interruptPort

Interrupt port used to detect then end of a conversion

View Source
Declaration
protected readonly IDigitalInterruptPort? interruptPort

Methods

Reset()

Reset the sensor

View Source
Declaration
public void Reset()

RaiseEventsAndNotify(IChangeResult<(MagneticField3D? MagneticField3D, Temperature? Temperature)>)

Raise events for subscribers and notify of value changes

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

ReadSensor()

Reads data from the sensor

View Source
Declaration
protected override Task<(MagneticField3D? MagneticField3D, Temperature? Temperature)> ReadSensor()
Returns

System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Units.Temperature>>>: The latest sensor reading

Implements

  • System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Units.Temperature>>>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Units.Temperature>>>
  • Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.MagneticField3D>,System.Nullable<Meadow.Units.Temperature>>>
  • System.IDisposable
  • Meadow.Peripherals.Sensors.ITemperatureSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.Motion.IMagnetometer
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.MagneticField3D>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.MagneticField3D>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • Meadow.Hardware.II2cPeripheral