Skip to content

Commit 786ec19

Browse files
Merge pull request #17 from jposada202020/adding_board.I2C_reference
Adding Learning Guides, changing references to board.I2C
2 parents 8296605 + fb07484 commit 786ec19

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ Usage Example
6363
6464
import time
6565
import board
66-
import busio
6766
import adafruit_pct2075
68-
i2c = busio.I2C(board.SCL, board.SDA)
6967
68+
i2c = board.I2C()
7069
pct = adafruit_pct2075.PCT2075(i2c)
7170
7271
while True:

adafruit_pct2075.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,23 @@ class PCT2075:
6969
"""Driver for the PCT2075 Digital Temperature Sensor and Thermal Watchdog.
7070
7171
:param ~busio.I2C i2c_bus: The I2C bus the PCT2075 is connected to.
72-
:param address: The I2C device address for the sensor. Default is :const:`0x37`
72+
:param address: The I2C device address. Default is :const:`0x37`
7373
7474
**Quickstart: Importing and using the PCT2075 temperature sensor**
7575
76-
Here is one way of importing the `PCT2075` class so you can use it with the name ``pct``.
76+
Here is an example of using the :class:`PCT2075` class.
7777
First you will need to import the libraries to use the sensor
7878
7979
.. code-block:: python
8080
81-
import busio
8281
import board
8382
import adafruit_pct2075
8483
85-
Once this is done you can define your `busio.I2C` object and define your sensor object
84+
Once this is done you can define your `board.I2C` object and define your sensor object
8685
8786
.. code-block:: python
8887
89-
i2c = busio.I2C(board.SCL, board.SDA)
88+
i2c = board.I2C() # uses board.SCL and board.SDA
9089
pct = adafruit_pct2075.PCT2075(i2c)
9190
9291
Now you have access to the temperature using the attribute :attr:`temperature`.

docs/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26+
Adafruit PCT2075 Temperature Sensor Learning Guide <https://learn.adafruit.com/adafruit-pct2075-temperature-sensor>
27+
2628
.. toctree::
2729
:caption: Related Products
2830

29-
.. Adafruit PCT2075 Breakout <https://www.adafruit.com/products/4369>
31+
Adafruit PCT2075 Temperature Sensor Breakout <https://www.adafruit.com/products/4369>
3032

3133
.. toctree::
3234
:caption: Other Links

examples/pct2075_high_temp_alert_example.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
import time
55
import board
6-
import busio
76
import adafruit_pct2075
87

9-
i2c = busio.I2C(board.SCL, board.SDA)
8+
i2c = board.I2C()
109
pct = adafruit_pct2075.PCT2075(i2c)
1110

1211
pct.high_temperature_threshold = 35.5

examples/pct2075_simpletest.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
import time
55
import board
6-
import busio
76
import adafruit_pct2075
87

9-
i2c = busio.I2C(board.SCL, board.SDA)
10-
8+
i2c = board.I2C()
119
pct = adafruit_pct2075.PCT2075(i2c)
1210

1311
while True:

0 commit comments

Comments
 (0)