108
108
109
109
110
110
class LSM303DLH_Mag :
111
- """Driver for the LSM303DLH's 'magnetometer."""
111
+ """Driver for the Driver for the LSM303DLH's 'magnetometer.
112
112
113
+ :param busio.I2C i2c_bus: The I2C bus the LSM303DLH is connected to.
114
+
115
+ """
113
116
# Class-level buffer for reading and writing data with the sensor.
114
117
# This reduces memory allocations but means the code is not re-entrant or
115
118
# thread safe!
@@ -124,7 +127,7 @@ def __init__(self, i2c):
124
127
self ._mag_rate = MAGRATE_0_7
125
128
126
129
@property
127
- def raw_magnetic (self ):
130
+ def _raw_magnetic (self ):
128
131
"""The raw magnetometer sensor values.
129
132
A 3-tuple of X, Y, Z axis values that are 16-bit signed integers.
130
133
"""
@@ -137,7 +140,7 @@ def magnetic(self):
137
140
"""The processed magnetometer sensor values.
138
141
A 3-tuple of X, Y, Z axis values in microteslas that are signed floats.
139
142
"""
140
- mag_x , mag_y , mag_z = self .raw_magnetic
143
+ mag_x , mag_y , mag_z = self ._raw_magnetic
141
144
return (mag_x / self ._lsm303mag_gauss_lsb_xy * _GAUSS_TO_MICROTESLA ,
142
145
mag_y / self ._lsm303mag_gauss_lsb_xy * _GAUSS_TO_MICROTESLA ,
143
146
mag_z / self ._lsm303mag_gauss_lsb_z * _GAUSS_TO_MICROTESLA )
0 commit comments