File tree 5 files changed +10
-13
lines changed 5 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,9 @@ Usage Example
63
63
64
64
import time
65
65
import board
66
- import busio
67
66
import adafruit_pct2075
68
- i2c = busio.I2C(board.SCL , board.SDA )
69
67
68
+ i2c = board.I2C()
70
69
pct = adafruit_pct2075.PCT2075(i2c)
71
70
72
71
while True :
Original file line number Diff line number Diff line change @@ -69,24 +69,23 @@ class PCT2075:
69
69
"""Driver for the PCT2075 Digital Temperature Sensor and Thermal Watchdog.
70
70
71
71
: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`
73
73
74
74
**Quickstart: Importing and using the PCT2075 temperature sensor**
75
75
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.
77
77
First you will need to import the libraries to use the sensor
78
78
79
79
.. code-block:: python
80
80
81
- import busio
82
81
import board
83
82
import adafruit_pct2075
84
83
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
86
85
87
86
.. code-block:: python
88
87
89
- i2c = busio .I2C(board.SCL, board.SDA)
88
+ i2c = board .I2C() # uses board.SCL and board.SDA
90
89
pct = adafruit_pct2075.PCT2075(i2c)
91
90
92
91
Now you have access to the temperature using the attribute :attr:`temperature`.
Original file line number Diff line number Diff line change @@ -23,10 +23,12 @@ Table of Contents
23
23
.. toctree ::
24
24
:caption: Tutorials
25
25
26
+ Adafruit PCT2075 Temperature Sensor Learning Guide <https://learn.adafruit.com/adafruit-pct2075-temperature-sensor >
27
+
26
28
.. toctree ::
27
29
:caption: Related Products
28
30
29
- .. Adafruit PCT2075 Breakout <https://www.adafruit.com/products/4369>
31
+ Adafruit PCT2075 Temperature Sensor Breakout <https://www.adafruit.com/products/4369 >
30
32
31
33
.. toctree ::
32
34
:caption: Other Links
Original file line number Diff line number Diff line change 3
3
4
4
import time
5
5
import board
6
- import busio
7
6
import adafruit_pct2075
8
7
9
- i2c = busio .I2C (board . SCL , board . SDA )
8
+ i2c = board .I2C ()
10
9
pct = adafruit_pct2075 .PCT2075 (i2c )
11
10
12
11
pct .high_temperature_threshold = 35.5
Original file line number Diff line number Diff line change 3
3
4
4
import time
5
5
import board
6
- import busio
7
6
import adafruit_pct2075
8
7
9
- i2c = busio .I2C (board .SCL , board .SDA )
10
-
8
+ i2c = board .I2C ()
11
9
pct = adafruit_pct2075 .PCT2075 (i2c )
12
10
13
11
while True :
You can’t perform that action at this time.
0 commit comments