compass HMC6352 trouble

26 Dec 2011

Just received the compass module. Can't get it to work. Below is a snippet of code.

#include "HMC6352.h"
#include "mbed.h"

//HMC6352 compass(p9, p10);
Serial pc(USBTX, USBRX);

int main() {

wait(10);
pc.printf("Starting HMC6352 test...\r\n");

}

This will print on serial terminal, but if I uncomment HMC6352, it will not. If I unplug the module, it will not print either. Maybe the module is defective?

11 Jan 2012

Depending on which breakout board you have for it - you might need to add the two standard I2C pullups?