@@ -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,51 @@ SPI Example
525
527
spi.readinto(self .buf)
526
528
return self .buf[0 ]
527
529
530
+
531
+
532
+ Class example template
533
+ --------------------------------------------------------------------------------
534
+ When documenting classes, you could use the following template to illustrate the basic class functioning.
535
+ it is closely related with the simpletest, however this will display the information in the readthedocs
536
+ documentation.
537
+ The advantage of using this, is users will be familiar with this as it is used across libraries
538
+
539
+ This is an example for a AHT20 temperature sensor. You could locate this after the class parameter
540
+ definitions.
541
+
542
+
543
+ .. code-block :: python
544
+
545
+ """
546
+
547
+ **Quickstart: Importing and using the AHT10/AHT20 temperature sensor**
548
+
549
+ Here is an example of using the :class:`AHTx0` class.
550
+ First you will need to import the libraries to use the sensor
551
+
552
+ .. code-block:: python
553
+
554
+ import board
555
+ import adafruit_ahtx0
556
+
557
+ Once this is done you can define your `board.I2C` object and define your sensor object
558
+
559
+ .. code-block:: python
560
+
561
+ i2c = board.I2C() # uses board.SCL and board.SDA
562
+ aht = adafruit_ahtx0.AHTx0(i2c)
563
+
564
+ Now you have access to the temperature and humidity using
565
+ the :attr:`temperature` and :attr:`relative_humidity` attributes
566
+
567
+ .. code-block:: python
568
+
569
+ temperature = aht.temperature
570
+ relative_humidity = aht.relative_humidity
571
+
572
+ """
573
+
574
+
528
575
Use composition
529
576
--------------------------------------------------------------------------------
530
577
0 commit comments