Aaron Berk
/
HMC6352_HelloWorld
Honeywell HMC6352 digital compass example.
Revision 0:f9a9be860001, committed 2010-08-26
- Comitter:
- aberk
- Date:
- Thu Aug 26 10:54:06 2010 +0000
- Child:
- 1:67f60f68719f
- Commit message:
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HMC6352_lib.lib Thu Aug 26 10:54:06 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/aberk/programs/HMC6352_lib/latest \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Aug 26 10:54:06 2010 +0000 @@ -0,0 +1,21 @@ +#include "HMC6352.h" + +HMC6352 compass(p9, p10); +Serial pc(USBTX, USBRX); + +int main() { + + pc.printf("Starting HMC6352 test...\n"); + + //Continuous mode, periodic set/reset, 20Hz measurement rate. + compass.setOpMode(HMC6352_CONTINUOUS, 1, 20); + + while (1) { + + wait(0.1); + + pc.printf("Heading is: %f\n", compass.sample() / 10.0); + + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Aug 26 10:54:06 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da