HMC6352 Digital Compass

The HMC6352 is a digital compass with an I2C interface.

Hello World

Import programHMC6352_HelloWorld

Honeywell HMC6352 digital compass example.

Library

Import libraryHMC6352

Honeywell HMC6352 digital compass library.

Pinout

Datasheet

http://www.ssec.honeywell.com/magnetic/datasheets/HMC6352.pdf

Notes

API

Import library

Public Member Functions

HMC6352 (PinName sda, PinName scl)
Constructor.
int sample (void)
Sample the device and return the result.
void setSleepMode (int enterOrExit)
Enter into or exit from sleep mode.
void setReset (void)
Update bridge offsets.
void setCalibrationMode (int enterOrExit)
Enter into or exit from calibration mode.
void saveOpMode (void)
Save the current operation mode byte to EEPROM.
int getSlaveAddress (void)
Read the memory location on the device which contains the slave address.
int getOffset (int axis)
Read the current offset for X or Y axis magnetometer.
void setOffset (int axis, int offset)
Set the offset for X or Y axis magnetometer.
int getTimeDelay (void)
Get the current time delay.
void setTimeDelay (int delay)
Set the time delay of the device.
int getSumNumber (void)
Get the number of measurements being summed each sample.
void setSumNumber (int sum)
Set the number of measurements being summed each sample.
int getSoftwareVersion (void)
Get the software version on the device.
int getOpMode (void)
Get the current operation mode.
void setOpMode (int mode, int periodicSetReset, int measurementRate=0)
Set the operation mode.
int getOutputMode (void)
Get the current output mode of the device.
void setOutputMode (int mode)
Set the output mode of the device.

You need to log in to post a discussion