45
45
46
46
47
47
class Thermistor :
48
- """Thermistor driver"""
48
+ """
49
+ :param ~microcontroller.Pin pin: Analog pin used for the thermistor
50
+ :param int series_resistor: resistance in series between you analog input and the
51
+ thermistor, normally a 10K resistor is placed between VCC and the analog pin
52
+ :param int nominal_resistance: nominal resistance of the thermistor. normally 10k
53
+ :param int b_coefficient: thermistor's B coefficient. Typically this is a value in
54
+ the range of 3000-4000
55
+ :param bool high_side: indicates if the thermistor is connected on the high side or
56
+ low side of the resistor. Defaults to `True`
57
+
58
+
59
+ **Quickstart: Importing and using the adafruit_thermistor library**
60
+
61
+ Here is one way of importing the `Thermistor` class so you can use it
62
+ with the name ``thermistor``.
63
+ First you will need to import the libraries to use the sensor
64
+
65
+ .. code-block:: python
66
+
67
+ import board
68
+ import adafruit_thermistor
69
+
70
+ Once this is done you can define your `Thermistor` object and define your sensor object
71
+
72
+ .. code-block:: python
73
+
74
+ thermistor = adafruit_thermistor.Thermistor(board.A0, 10000, 10000, 25, 3950)
75
+
76
+ Now you have access to the temperature with the :attr:`temperature` attribute.
77
+ This temperature is in Celsius.
78
+
79
+
80
+ .. code-block:: python
81
+
82
+ temperature = thermistor.temperature
83
+
84
+ """
49
85
50
86
def __init__ (
51
87
self ,
@@ -67,7 +103,7 @@ def __init__(
67
103
68
104
@property
69
105
def temperature (self ):
70
- """The temperature of the thermistor in celsius """
106
+ """The temperature of the thermistor in Celsius """
71
107
if self .high_side :
72
108
# Thermistor connected from analog input to high logic level.
73
109
reading = self .pin .value / 64
0 commit comments