|
1 | 1 | Adafruit Python DHT Sensor Library |
2 | 2 | ================================== |
3 | 3 |
|
4 | | -Python library to read the DHT series of humidity and temperature sensors on a Raspberry Pi or Beaglebone Black. |
| 4 | +Python library to read the DHT series of humidity and temperature sensors on a |
| 5 | +Raspberry Pi or Beaglebone Black. |
5 | 6 |
|
6 | | -Designed specifically to work with the Adafruit DHT series sensors ----> https://www.adafruit.com/products/385 |
| 7 | +Designed specifically to work with the Adafruit DHT series sensors ----> |
| 8 | +https://www.adafruit.com/products/385 |
7 | 9 |
|
8 | | -Currently the library is tested with Python 2.6, 2.7, 3.3 and 3.4. It should work with Python greater than 3.4, too. |
| 10 | +Currently the library is tested with Python 2.6, 2.7, 3.3 and 3.4. It should |
| 11 | +work with Python greater than 3.4, too. |
9 | 12 |
|
10 | | -For all platforms (Raspberry Pi and Beaglebone Black) make sure your system is able to compile Python extensions. On Raspbian or Beaglebone Black's Debian/Ubuntu image you can ensure your system is ready by executing: |
| 13 | +Installing |
| 14 | +---------- |
11 | 15 |
|
12 | | -```` |
| 16 | +### Dependencies |
| 17 | + |
| 18 | +For all platforms (Raspberry Pi and Beaglebone Black) make sure your system is |
| 19 | +able to compile and download Python extensions with **pip**: |
| 20 | + |
| 21 | +On Raspbian or Beaglebone Black's Debian/Ubuntu image you can ensure your |
| 22 | +system is ready by running one or two of the following sets of commands: |
| 23 | + |
| 24 | +Python 2: |
| 25 | + |
| 26 | +````sh |
13 | 27 | sudo apt-get update |
14 | | -sudo apt-get install build-essential python-dev |
| 28 | +sudo apt-get install python-pip |
| 29 | +sudo python -m pip install --upgrade pip setuptools wheel |
15 | 30 | ```` |
16 | 31 |
|
17 | | -Install the library by downloading with the download link on the right, unzipping the archive, and executing: |
| 32 | +Python 3: |
18 | 33 |
|
| 34 | +````sh |
| 35 | +sudo apt-get update |
| 36 | +sudo apt-get install python3-pip |
| 37 | +sudo python3 -m pip install --upgrade pip setuptools wheel |
19 | 38 | ```` |
| 39 | + |
| 40 | +### Install with pip |
| 41 | + |
| 42 | +Use `pip` to install from PyPI. |
| 43 | + |
| 44 | +Python 2: |
| 45 | + |
| 46 | +```sh |
| 47 | +sudo pip install Adafruit_DHT |
| 48 | +``` |
| 49 | + |
| 50 | +Python 3: |
| 51 | + |
| 52 | +```sh |
| 53 | +sudo pip3 install Adafruit_DHT |
| 54 | +``` |
| 55 | + |
| 56 | +### Compile and install from the repository |
| 57 | + |
| 58 | +First download the library source code from the [GitHub releases |
| 59 | +page](https://github.com/adafruit/Adafruit_Python_DHT/releases), unzipping the |
| 60 | +archive, and execute: |
| 61 | + |
| 62 | +Python 2: |
| 63 | + |
| 64 | +```sh |
| 65 | +cd Adafruit_Python_DHT |
20 | 66 | sudo python setup.py install |
21 | | -```` |
22 | | -You can ommit the sudo if you use raspberry pi. |
| 67 | +``` |
| 68 | + |
| 69 | +Python 3: |
| 70 | + |
| 71 | +```sh |
| 72 | +cd Adafruit_Python_DHT |
| 73 | +sudo python3 setup.py install |
| 74 | +``` |
| 75 | + |
| 76 | +You may also git clone the repository if you want to test an unreleased |
| 77 | +version: |
| 78 | + |
| 79 | +```sh |
| 80 | +git clone https://github.com/adafruit/Adafruit_Python_DHT.git |
| 81 | +``` |
| 82 | + |
| 83 | +Usage |
| 84 | +----- |
23 | 85 |
|
24 | 86 | See example of usage in the examples folder. |
25 | 87 |
|
26 | | -Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! |
| 88 | +Author |
| 89 | +------ |
| 90 | + |
| 91 | +Adafruit invests time and resources providing this open source code, please |
| 92 | +support Adafruit and open-source hardware by purchasing products from Adafruit! |
27 | 93 |
|
28 | 94 | Written by Tony DiCola for Adafruit Industries. |
29 | 95 |
|
|
0 commit comments