diff --git a/README.rst b/README.rst index 8eced9e..9cec015 100644 --- a/README.rst +++ b/README.rst @@ -63,10 +63,9 @@ Usage Example import time import board - import busio import adafruit_tmp117 - i2c = busio.I2C(board.SCL, board.SDA) + i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = adafruit_tmp117.TMP117(i2c) while True: diff --git a/adafruit_tmp117.py b/adafruit_tmp117.py index 629cc61..058971d 100644 --- a/adafruit_tmp117.py +++ b/adafruit_tmp117.py @@ -21,15 +21,20 @@ **Hardware:** -* `Adafruit TMP117 Breakout `_ +* `Adafruit TMP117 ±0.1°C High Accuracy I2C Temperature Sensor + `_ (Product ID: 4821) **Software and Dependencies:** * Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases + https://circuitpython.org/downloads + +* Adafruit's Bus Device library: + https://github.com/adafruit/Adafruit_CircuitPython_BusDevice + +* Adafruit's Register library: + https://github.com/adafruit/Adafruit_CircuitPython_Register -* Adafruit's Bus Device library https://github.com/adafruit/Adafruit_CircuitPython_BusDevice -* Adafruit's Register library https://github.com/adafruit/Adafruit_CircuitPython_Register """ import time @@ -202,7 +207,7 @@ def initialize(self): @property def temperature(self): - """The current measured temperature in degrees celcius""" + """The current measured temperature in degrees Celsius""" return self._read_temperature() @@ -210,17 +215,13 @@ def temperature(self): def temperature_offset(self): """User defined temperature offset to be added to measurements from `temperature` - .. code-block::python3 + .. code-block::python - # SPDX-FileCopyrightText: 2020 Bryan Siepert, written for Adafruit Industries - # - # SPDX-License-Identifier: Unlicense import time import board - import busio import adafruit_tmp117 - i2c = busio.I2C(board.SCL, board.SDA) + i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = adafruit_tmp117.TMP117(i2c) @@ -242,7 +243,7 @@ def temperature_offset(self, value): @property def high_limit(self): - """The high temperature limit in degrees celcius. When the measured temperature exceeds this + """The high temperature limit in degrees Celsius. When the measured temperature exceeds this value, the `high_alert` attribute of the `alert_status` property will be True. See the documentation for `alert_status` for more information""" @@ -257,7 +258,7 @@ def high_limit(self, value): @property def low_limit(self): - """The low temperature limit in degrees celcius. When the measured temperature goes below + """The low temperature limit in degrees Celsius. When the measured temperature goes below this value, the `low_alert` attribute of the `alert_status` property will be True. See the documentation for `alert_status` for more information""" @@ -275,12 +276,11 @@ def alert_status(self): """The current triggered status of the high and low temperature alerts as a AlertStatus named tuple with attributes for the triggered status of each alert. - .. code-block :: python3 + .. code-block :: python import board - import busio import adafruit_tmp117 - i2c = busio.I2C(board.SCL, board.SDA) + i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = adafruit_tmp117.TMP117(i2c) @@ -323,10 +323,9 @@ def averaged_measurements(self): import time import board - import busio from adafruit_tmp117 import TMP117, AverageCount - i2c = busio.I2C(board.SCL, board.SDA) + i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = TMP117(i2c) @@ -412,14 +411,13 @@ def measurement_delay(self): current setting off `averaged_measurements` which determines the minimum time needed between reported measurements. - .. code-block::python3 + .. code-block::python import time import board - import busio from adafruit_tmp117 import TMP117, AverageCount, MeasurementDelay - i2c = busio.I2C(board.SCL, board.SDA) + ii2c = board.I2C() # uses board.SCL and board.SDA tmp117 = TMP117(i2c) diff --git a/docs/api.rst b/docs/api.rst index ac174de..cac63f7 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -6,3 +6,4 @@ .. automodule:: adafruit_tmp117 :members: + :exclude-members: CV diff --git a/docs/index.rst b/docs/index.rst index a6c6dd9..60c316b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,11 +23,12 @@ Table of Contents .. toctree:: :caption: Tutorials + Adafruit TMP117 ±0.1°C High Accuracy I2C Temperature Sensor Learning Guide .. toctree:: :caption: Related Products -* Adafruit TMP117 Breakout `_ + Adafruit TMP117 ±0.1°C High Accuracy I2C Temperature Sensor .. toctree:: diff --git a/examples/tmp117_limits_test.py b/examples/tmp117_limits_test.py index 617be60..794aec2 100644 --- a/examples/tmp117_limits_test.py +++ b/examples/tmp117_limits_test.py @@ -3,10 +3,9 @@ # SPDX-License-Identifier: Unlicense import time import board -import busio from adafruit_tmp117 import TMP117, AlertMode -i2c = busio.I2C(board.SCL, board.SDA) +i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = TMP117(i2c) diff --git a/examples/tmp117_offset_test.py b/examples/tmp117_offset_test.py index 93a7616..804b31a 100644 --- a/examples/tmp117_offset_test.py +++ b/examples/tmp117_offset_test.py @@ -3,10 +3,9 @@ # SPDX-License-Identifier: Unlicense import time import board -import busio import adafruit_tmp117 -i2c = busio.I2C(board.SCL, board.SDA) +i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = adafruit_tmp117.TMP117(i2c) diff --git a/examples/tmp117_rate_and_averaging_test.py b/examples/tmp117_rate_and_averaging_test.py index 311e6da..6a3f19b 100644 --- a/examples/tmp117_rate_and_averaging_test.py +++ b/examples/tmp117_rate_and_averaging_test.py @@ -7,10 +7,9 @@ # such as the one built into the Mu editor. import time import board -import busio from adafruit_tmp117 import TMP117, AverageCount, MeasurementDelay -i2c = busio.I2C(board.SCL, board.SDA) +i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = TMP117(i2c) # uncomment different options below to see how it affects the reported temperature diff --git a/examples/tmp117_simpletest.py b/examples/tmp117_simpletest.py index 5bb1eea..564185e 100644 --- a/examples/tmp117_simpletest.py +++ b/examples/tmp117_simpletest.py @@ -3,10 +3,9 @@ # SPDX-License-Identifier: Unlicense import time import board -import busio import adafruit_tmp117 -i2c = busio.I2C(board.SCL, board.SDA) +i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = adafruit_tmp117.TMP117(i2c) while True: diff --git a/examples/tmp117_single_measurement_test.py b/examples/tmp117_single_measurement_test.py index 2c6696c..f2938b5 100644 --- a/examples/tmp117_single_measurement_test.py +++ b/examples/tmp117_single_measurement_test.py @@ -2,11 +2,9 @@ # # SPDX-License-Identifier: Unlicense import board -import busio from adafruit_tmp117 import TMP117, AverageCount -i2c = busio.I2C(board.SCL, board.SDA) - +i2c = board.I2C() # uses board.SCL and board.SDA tmp117 = TMP117(i2c) # uncomment different options below to see how it affects the reported temperature