Characteristic Locus
Inheritance System.Object > Hmc5883 > Qmc5883
Inherited Members System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Foundation.Sensors.Motion
Assembly Hmc5883.dll

Syntax

public class Hmc5883

Constructors

Hmc5883()

Make the default constructor private so that the developer cannot access it.

Declaration
protected Hmc5883()

Hmc5883(II2cBus, Byte, Hmc5883.Gain, Hmc5883.MeasuringMode, Hmc5883.OutputRate, Hmc5883.SamplesAmount, Hmc5883.MeasurementConfiguration)

Declaration
public Hmc5883(II2cBus i2cBus, byte address = 30, Hmc5883.Gain gain = Hmc5883.Gain.Gain1090, Hmc5883.MeasuringMode measuringMode = Hmc5883.MeasuringMode.Continuous, Hmc5883.OutputRate outputRate = Hmc5883.OutputRate.Rate15, Hmc5883.SamplesAmount samplesAmount = default(Hmc5883.SamplesAmount), Hmc5883.MeasurementConfiguration measurementConfig = default(Hmc5883.MeasurementConfiguration))

Parameters

Type Name Description
II2cBus i2cBus
System.Byte address
Hmc5883.Gain gain
Hmc5883.MeasuringMode measuringMode
Hmc5883.OutputRate outputRate
Hmc5883.SamplesAmount samplesAmount
Hmc5883.MeasurementConfiguration measurementConfig

Fields

DefaultI2cAddress

HMC5883L Default I2C Address

Declaration
public const byte DefaultI2cAddress = 30

Field Value

Type Description
System.Byte

gain

Declaration
protected byte gain

Field Value

Type Description
System.Byte

i2cPeripheral

Declaration
protected static II2cPeripheral i2cPeripheral

Field Value

Type Description
II2cPeripheral

measurementConfig

Declaration
protected byte measurementConfig

Field Value

Type Description
System.Byte

measuringMode

Declaration
protected byte measuringMode

Field Value

Type Description
System.Byte

outputRate

Declaration
protected byte outputRate

Field Value

Type Description
System.Byte

sampleAmount

Declaration
protected byte sampleAmount

Field Value

Type Description
System.Byte

Properties

DeviceStatus

HMC5883L Status

Declaration
public Hmc5883.Status DeviceStatus { get; }

Property Value

Type Description
Hmc5883.Status

Direction

HMC5883L Direction as a Vector

Declaration
public Vector Direction { get; }

Property Value

Type Description
Vector

Heading

HMC5883L Heading (DEG)

Declaration
public double Heading { get; }

Property Value

Type Description
System.Double

Methods

DirectionToHeading(Vector)

Calculate heading

Declaration
protected double DirectionToHeading(Vector direction)

Parameters

Type Name Description
Vector direction

HMC5883L Direction

Returns

Type Description
System.Double

Heading (DEG)

Initialize()

Declaration
protected virtual void Initialize()

Events

DirectionChanged

Event to be raised when the compass changes

Declaration
public event SensorVectorEventHandler DirectionChanged

Event Type

Type Description
SensorVectorEventHandler