Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
40 changes: 19 additions & 21 deletions adafruit_tmp117.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@

**Hardware:**

* `Adafruit TMP117 Breakout <https:#www.adafruit.com/product/4821>`_
* `Adafruit TMP117 ±0.1°C High Accuracy I2C Temperature Sensor
<https://www.adafruit.com/product/4821>`_ (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
Expand Down Expand Up @@ -202,25 +207,21 @@ 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()

@property
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)

Expand All @@ -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"""

Expand All @@ -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"""

Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

.. automodule:: adafruit_tmp117
:members:
:exclude-members: CV
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ Table of Contents
.. toctree::
:caption: Tutorials

Adafruit TMP117 ±0.1°C High Accuracy I2C Temperature Sensor Learning Guide <https://learn.adafruit.com/adafruit-tmp117-high-accuracy-i2c-temperature-monitor>

.. toctree::
:caption: Related Products

* Adafruit TMP117 Breakout <https://www.adafruit.com/product/PID_HERE>`_
Adafruit TMP117 ±0.1°C High Accuracy I2C Temperature Sensor <https://www.adafruit.com/product/4821>


.. toctree::
Expand Down
3 changes: 1 addition & 2 deletions examples/tmp117_limits_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions examples/tmp117_offset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions examples/tmp117_rate_and_averaging_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/tmp117_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions examples/tmp117_single_measurement_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down