Skip to content

Commit ac70d83

Browse files
authored
Merge pull request #3 from adafruit/magnetometer_fix
fixing magnetometer for issue #1
2 parents 71a931c + 6b090ba commit ac70d83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_lis3mdl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
_LIS3MDL_INT_CFG = const(0x30) # Interrupt configuration register
7373
_LIS3MDL_INT_THS_L = const(0x32) # Low byte of the irq threshold
7474

75-
_GAUSS_TO_MT = 0.1 #1 Gauss [G] = 0.1 Millitesla [mT]
75+
_GAUSS_TO_UT = 100
7676

7777
class CV:
7878
"""struct helper"""
@@ -233,7 +233,7 @@ def magnetic(self):
233233
return(x, y, z)
234234

235235
def _scale_mag_data(self, raw_measurement): #pylint: disable=no-self-use
236-
return (raw_measurement / Range.lsb[self.range]) * _GAUSS_TO_MT
236+
return (raw_measurement / Range.lsb[self.range]) * _GAUSS_TO_UT
237237

238238
@property
239239
def range(self):

0 commit comments

Comments
 (0)