IMPORTANT: The HMC58X3 library is now part of the FreeIMU library. Please refer to the FreeIMU library page for newer code. See http://
This is a libre Arduino Library for the HMC5843 and HMC5883L Honeywell magnetometers.
Both the HMC5843 and HMC5883L are supported by the library.
By default the library assumes you are using the HMC5883L. In order to use the library with the HMC5843 you have to edit the file HMC58X3.h and uncomment the line "#define ISHMC5843".
IMPORTANT: note that this library doesn't disable the internal pullups of the Arduino (which the Wire library enable by default). Using a logic level converter is required to avoid burning your chip. In case you don't have an LLC you can modify your twi.c file which you find in your Arduino IDE install and then you'll find it in the folder
libraries/
#if defined(
defined(
// activate internal pull-ups for twi
// as per note from atmega8 manual pg167
sbi(PORTC, 4);
sbi(PORTC, 5);
#else
// activate internal pull-ups for twi
// as per note from atmega128 manual pg204
sbi(PORTD, 0);
sbi(PORTD, 1);
#endif
into:
// #if defined(
// // activate internal pull-ups for twi
// // as per note from atmega8 manual pg167
// sbi(PORTC, 4);
// sbi(PORTC, 5);
// #else
// // activate internal pull-ups for twi
// // as per note from atmega128 manual pg204
// sbi(PORTD, 0);
// sbi(PORTD, 1);
// #endif
View full history Series and milestones
trunk series is the current focus of development.