Registered by Fabio Varesano

IMPORTANT: The HMC58X3 library is now part of the FreeIMU library. Please refer to the FreeIMU library page for newer code. See http://www.varesano.net/projects/hardware/FreeIMU#library

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/Wire/utility/ .. Change the following lines:

 #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega8__) ||
defined(__AVR_ATmega328P__)
    // 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(__AVR_ATmega168__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega328P__)
// // 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

Project information

Maintainer:
Fabio Varesano
Driver:
Fabio Varesano
Licence:
GNU GPL v3

RDF metadata

View full history Series and milestones

trunk series is the current focus of development.

All code Code

Version control system:
Bazaar
Programming languages:
C, C++

Get Involved

Downloads

Latest version is v0.4
released

All downloads