@@ -6,9 +6,10 @@ Introduction
6
6
:target: https://circuitpython.readthedocs.io/projects/dht/en/latest/
7
7
:alt: Documentation Status
8
8
9
- .. image :: https://badges.gitter.im/adafruit/circuitpython.svg
10
- :target: https://gitter.im/adafruit/circuitpython?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
11
- :alt: Gitter
9
+
10
+ .. image :: https://img.shields.io/discord/327254708534116352.svg
11
+ :target: https://discord.gg/nBQh6qu
12
+ :alt: Discord
12
13
13
14
CircuitPython support for the DHT11 and DHT22 temperature and humidity devices.
14
15
@@ -23,17 +24,17 @@ This is easily achieved by downloading
23
24
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle >`_.
24
25
25
26
Usage Example
26
- =============
27
+ ==============
27
28
28
29
Hardware Set-up
29
- ---------------
30
+ ----------------
30
31
31
32
The DHT11 and DHT22 devices both need a pull-resistor on the data signal wire.
32
33
This resistor is in the range of 1k to 5k. Please check your device datasheet for the
33
34
appropriate value.
34
35
35
36
Basics
36
- ------
37
+ -------
37
38
38
39
Of course, you must import the library to use it:
39
40
@@ -60,7 +61,7 @@ OR initialize the DHT22 device:
60
61
dht_device = adafruit_dht.DHT22(< pin> )
61
62
62
63
Read temperature and humidity
63
- ----------------------------
64
+ ------------------------------
64
65
65
66
Now get the temperature and humidity values
66
67
@@ -79,10 +80,50 @@ Contributions are welcome! Please read our `Code of Conduct
79
80
<https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/master/CODE_OF_CONDUCT.md> `_
80
81
before contributing to help this project stay welcoming.
81
82
82
- API Reference
83
- =============
83
+ Building locally
84
+ ================
85
+
86
+ To build this library locally you'll need to install the
87
+ `circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools >`_ package.
88
+
89
+ .. code-block :: shell
90
+
91
+ python3 -m venv .env
92
+ source .env/bin/activate
93
+ pip install circuitpython-build-tools
94
+
95
+ Once installed, make sure you are in the virtual environment:
96
+
97
+ .. code-block :: shell
98
+
99
+ source .env/bin/activate
100
+
101
+ Then run the build:
102
+
103
+ .. code-block :: shell
104
+
105
+ circuitpython-build-bundles --filename_prefix adafruit-circuitpython-veml6070 --library_location .
106
+
107
+ Sphinx documentation
108
+ -----------------------
109
+
110
+ Sphinx is used to build the documentation based on rST files and comments in the code. First,
111
+ install dependencies (feel free to reuse the virtual environment from above):
112
+
113
+ .. code-block :: shell
114
+
115
+ python3 -m venv .env
116
+ source .env/bin/activate
117
+ pip install Sphinx sphinx-rtd-theme
118
+
119
+ Now, once you have the virtual environment activated:
120
+
121
+ .. code-block :: shell
122
+
123
+ cd docs
124
+ sphinx-build -E -W -b html . _build/html
84
125
85
- .. toctree ::
86
- :maxdepth: 2
126
+ This will output the documentation to ``docs/_build/html ``. Open the index.html in your browser to
127
+ view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
128
+ locally verify it will pass.
87
129
88
- api
0 commit comments