Seeed_Python_Ds18b20
DS18B20 Waterproof Temperature Sensor is a digital sensor which can reach the digital data resolution up to 12 bits and has ±0.5°C accuracy from -10°C to +85°C. It includes an analog-to-digital converter to convert the analog signal to the digital output with the resolution up to 12 bits.
Dependencies
This driver depends on:
This is easy to install with the following command.
pip3 install Seeed-grove.py
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install seeed-python-Ds18b20
To install system-wide (this may be required in some cases):
sudo pip3 install seeed-python-Ds18b20
if you want to update the driver locally from PyPI. you can use:
pip3 install --upgrade seeed-python-Ds18b20
Usage
connect Ds18b20 to D5 at BaseHat.
import seeed_ds18b20
import time
def main():
DS18B20 = seeed_ds18b20.grove_ds18b20()
print("Please use Ctrl C to quit")
while True:
temp_c,temp_f = DS18B20.read_temp
print('temp_c %.2f C temp_f %.2f F' % (temp_c,temp_f),end=" ")
print('\r', end='')
time.sleep(0.5)
if __name__ == "__main__":
main()
API Reference
- uint16_t,uint16_t read_temp(void):return temperature
temp_c,temp_f = DS18B20.read_temp
Metadata
Release files for seeed-python-Ds18b20 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| seeed_python_Ds18b20-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Release files / seeed_python_Ds18b20-1.0.0-py2.py3-none-any.whl
| Download URL | seeed_python_Ds18b20-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7a9e8f7292ac5096c8c9c4ca1985f82846e2b82e891579eb64cb7cf620a9ef85
|
|
BLAKE2b-256 checksum How to use checksums |
36ea77ac92af4c1b6f809a23605390965084a535ec4a2ebb83417718140dc209
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3
|