modified LSM303D library to work with AltIMU-v4

Fork of LSM303D by brian claus

Files at this revision

API Documentation at this revision

Comitter:
avachen
Date:
Sun Mar 06 00:35:23 2016 +0000
Parent:
0:5b930e09bd6e
Commit message:
proofreading

Changed in this revision

LSM303D.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5b930e09bd6e -r df6411cb3278 LSM303D.cpp
--- a/LSM303D.cpp	Wed Feb 03 20:57:01 2016 +0000
+++ b/LSM303D.cpp	Sun Mar 06 00:35:23 2016 +0000
@@ -50,14 +50,14 @@
     OUT_Y_A     = 0x2A,
     OUT_Z_A     = 0x2C,
     //
-    CTRL0       = 0x1F;
-    CTRL1       = 0x20;
-    CTRL2       = 0x21;
-    CTRL3       = 0x22;
-    CTRL4       = 0x23;
-    CTRL5       = 0x24;
-    CTRL6       = 0x25;
-    CTRL7       = 0x26;
+    CTRL0       = 0x1F,
+    CTRL1       = 0x20,
+    CTRL2       = 0x21,
+    CTRL3       = 0x22,
+    CTRL4       = 0x23,
+    CTRL5       = 0x24,
+    CTRL6       = 0x25,
+    CTRL7       = 0x26
 };
 
 bool LSM303D::write_reg(int addr_i2c,int addr_reg, char v)
@@ -101,7 +101,7 @@
 
     reg_v = 0;    
     reg_v |= 0x00;   //continuous mag
-    write_reg(addr_mag,CTRL7,reg_v);
+    write_reg(addr_acc_mag,CTRL7,reg_v);
 }