Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 795 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 795 Bytes

HMC5883L

HMC5883L is a surface-mount, multi-chip module designed for low-field magnetic sensing with a digital interface for applications such as lowcost compassing and magnetometry.

Sensor Image

Usage

I2cConnectionSettings settings = new I2cConnectionSettings(1, Hmc5883l.I2cAddress);
// get I2cDevice (in Linux)
UnixI2cDevice device = new UnixI2cDevice(settings);
// get I2cDevice (in Win10)
//Windows10I2cDevice device = new Windows10I2cDevice(settings);

using (Hmc5883l sensor = new Hmc5883l(device))
{
    // read direction vector
    Vector3 directionVector = sensor.DirectionVector;
    // read direction angle
    double angle = sensor.Heading;

    // use sensor
}

References

https://cdn.datasheetspdf.com/pdf-down/H/M/C/HMC5883L-Honeywell.pdf