@@ -251,15 +251,17 @@ After the license comment::
251
251
252
252
**Hardware:**
253
253
254
- * Adafruit ` Device Description
254
+ * ` Adafruit Device Description
255
255
<hyperlink>`_ (Product ID: <Product Number>)
256
256
257
257
**Software and Dependencies:**
258
258
259
259
* Adafruit CircuitPython firmware for the supported boards:
260
260
https://circuitpython.org/downloads
261
+
261
262
* Adafruit's Bus Device library:
262
263
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
264
+
263
265
* Adafruit's Register library:
264
266
https://github.com/adafruit/Adafruit_CircuitPython_Register
265
267
@@ -525,6 +527,50 @@ SPI Example
525
527
spi.readinto(self .buf)
526
528
return self .buf[0 ]
527
529
530
+
531
+
532
+ Class documentation example template
533
+ --------------------------------------------------------------------------------
534
+ When documenting classes, you should use the following template to illustrate basic usage.
535
+ It is similar with the simpletest example, however this will display the information in the Read The Docs
536
+ documentation.
537
+ The advantage of using this template is it makes the documentation consistent across the libraries.
538
+
539
+ This is an example for a AHT20 temperature sensor. Include the following after the class parameter:
540
+
541
+
542
+ .. code-block :: python
543
+
544
+ """
545
+
546
+ **Quickstart: Importing and using the AHT10/AHT20 temperature sensor**
547
+
548
+ Here is an example of using the :class:`AHTx0` class.
549
+ First you will need to import the libraries to use the sensor
550
+
551
+ .. code-block:: python
552
+
553
+ import board
554
+ import adafruit_ahtx0
555
+
556
+ Once this is done you can define your `board.I2C` object and define your sensor object
557
+
558
+ .. code-block:: python
559
+
560
+ i2c = board.I2C() # uses board.SCL and board.SDA
561
+ aht = adafruit_ahtx0.AHTx0(i2c)
562
+
563
+ Now you have access to the temperature and humidity using
564
+ the :attr:`temperature` and :attr:`relative_humidity` attributes
565
+
566
+ .. code-block:: python
567
+
568
+ temperature = aht.temperature
569
+ relative_humidity = aht.relative_humidity
570
+
571
+ """
572
+
573
+
528
574
Use composition
529
575
--------------------------------------------------------------------------------
530
576
0 commit comments