Skip to content

Commit 01350a9

Browse files
committed
adding_doc
1 parent 2b9f251 commit 01350a9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

adafruit_emc2101/__init__.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,34 @@ class EMC2101: # pylint: disable=too-many-instance-attributes
142142
143143
:param ~busio.I2C i2c_bus: The I2C bus the EMC is connected to.
144144
145+
146+
**Quickstart: Importing and using the device**
147+
148+
Here is an example of using the :class:`EMC2101` class.
149+
First you will need to import the libraries to use the sensor
150+
151+
.. code-block:: python
152+
153+
import board
154+
from adafruit_emc2101.emc2101_lut import EMC2101_LUT as EMC2101
155+
156+
Once this is done you can define your `board.I2C` object and define your sensor object
157+
158+
.. code-block:: python
159+
160+
i2c = board.I2C() # uses board.SCL and board.SDA
161+
emc = EMC2101(i2c)
162+
163+
Now you have access to the :attr:`manual_fan_speed` attribute to setup the
164+
desired fanspeed
165+
166+
.. code-block:: python
167+
168+
emc.manual_fan_speed = 25
169+
170+
171+
172+
145173
If you need control over PWM frequency and the controller's built in temperature/speed
146174
look-up table (LUT), you will need :class:`emc2101_lut.EMC2101_LUT` which extends this
147175
class to add those features, at the cost of increased memory usage.

0 commit comments

Comments
 (0)