From b7f9f04f82a94af37577e60bb40f65f3c7d03a87 Mon Sep 17 00:00:00 2001 From: siddacious Date: Mon, 14 Oct 2019 14:48:24 -0700 Subject: [PATCH] polishing dox --- .gitignore | 3 ++- adafruit_lsm303dlh_mag.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 55f127b..3573d73 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ bundles *.DS_Store .eggs dist -**/*.egg-info \ No newline at end of file +**/*.egg-info +.vscode diff --git a/adafruit_lsm303dlh_mag.py b/adafruit_lsm303dlh_mag.py index 07cefd0..ccdc5b5 100644 --- a/adafruit_lsm303dlh_mag.py +++ b/adafruit_lsm303dlh_mag.py @@ -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! @@ -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. """ @@ -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)