Jonathan Goret
/
Nucleo_gyro_magno
same
Revision 0:b70138c005b7, committed 2015-04-13
- Comitter:
- johnylafleur
- Date:
- Mon Apr 13 16:06:18 2015 +0000
- Commit message:
- same;
Changed in this revision
diff -r 000000000000 -r b70138c005b7 LSM303DLH.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LSM303DLH.lib Mon Apr 13 16:06:18 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/johnylafleur/code/LSM303DLH/#38cd86f4249d
diff -r 000000000000 -r b70138c005b7 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Apr 13 16:06:18 2015 +0000 @@ -0,0 +1,19 @@ + #include "mbed.h" + #include "LSM303DLH.h" + + Serial debug(USBTX,USBRX); +LSM303DLH compass(PB_9, PB_8); + + int main() { + float hdg; + debug.format(8,Serial::None,1); + debug.baud(115200); + debug.printf("LSM303DLH Test\x0d\x0a"); + compass.setOffset(29.50, -0.50, 4.00); // example calibration + compass.setScale(1.00, 1.03, 1.21); // example calibration + while(1) { + hdg = compass.heading(); + debug.printf("Heading: %.2f\n", hdg); + wait(0.1); + } + } \ No newline at end of file
diff -r 000000000000 -r b70138c005b7 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Apr 13 16:06:18 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0 \ No newline at end of file