WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation


The HMC6343 compass sensor.
Manufacturers Datasheet: http://www.ssec.honeywell.com/magnetic/datasheets/HMC6343.pdf
Suppliers: http://www.sparkfun.com/commerce/product_info.php?products_id=8656
This compass is accessed over I2C at address 0x32 but this address can be changed by sending it the relevant command if you know what you are doing!
To create a device at the default address use:-
HMC6343 compass = MAKE_HMC6343();

or if you have changed the address to say 0x40 then use:
HMC6343 compass = MAKE_HMC6343_At(0x40);
Example for the Axon:-
#include "sys/Axon.h"
#include "rprintf.h"
#include "Sensors/Compass/Honeywell/HMC6343.h"

HMC6343 compass = MAKE_HMC6343();

void appInitHardware(void){
   //setup UART
   uartInit(UART1, 9600);
   // Initialise compass

TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
   return 0;

// This is the main loop
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){
   rprintf("Compass = %d\n",compass.compass.bearingDegrees);
   return 0;




void HMC6343_1Hz(HMC6343* compass)

Changes the default refresh rate to once per second.

void HMC6343_5Hz(HMC6343* compass)

Changes the default refresh rate to five temes per second (ie every 200ms)

void HMC6343_10Hz(HMC6343* compass)

Changes the default refresh rate to ten timer per second ie every 100ms

Valid XHTML 1.0 Transitional