Skip to content

Commit

Permalink
polishing dox
Browse files Browse the repository at this point in the history
  • Loading branch information
siddacious committed Oct 14, 2019
1 parent 24bc1df commit b7f9f04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ bundles
*.DS_Store
.eggs
dist
**/*.egg-info
**/*.egg-info
.vscode
9 changes: 6 additions & 3 deletions adafruit_lsm303dlh_mag.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@


class LSM303DLH_Mag:
"""Driver for the LSM303DLH's 'magnetometer."""
"""Driver for the Driver for the LSM303DLH's 'magnetometer.
:param busio.I2C i2c_bus: The I2C bus the LSM303DLH is connected to.
"""
# Class-level buffer for reading and writing data with the sensor.
# This reduces memory allocations but means the code is not re-entrant or
# thread safe!
Expand All @@ -124,7 +127,7 @@ def __init__(self, i2c):
self._mag_rate = MAGRATE_0_7

@property
def raw_magnetic(self):
def _raw_magnetic(self):
"""The raw magnetometer sensor values.
A 3-tuple of X, Y, Z axis values that are 16-bit signed integers.
"""
Expand All @@ -137,7 +140,7 @@ def magnetic(self):
"""The processed magnetometer sensor values.
A 3-tuple of X, Y, Z axis values in microteslas that are signed floats.
"""
mag_x, mag_y, mag_z = self.raw_magnetic
mag_x, mag_y, mag_z = self._raw_magnetic
return (mag_x / self._lsm303mag_gauss_lsb_xy * _GAUSS_TO_MICROTESLA,
mag_y / self._lsm303mag_gauss_lsb_xy * _GAUSS_TO_MICROTESLA,
mag_z / self._lsm303mag_gauss_lsb_z * _GAUSS_TO_MICROTESLA)
Expand Down

0 comments on commit b7f9f04

Please sign in to comment.