GreenPonik DS198B20 One Wire read temperature
Project description
GreenPonik_OneWire_DS18B20.py Library for Raspberry pi
This is the sample code for read temperature with DS18B20 sensor on One Wire bus.
The script auto-detect the 1W file and parse it to find the temperature value.
Table of Contents
- GreenPonik_OneWire_DS18B20.py Library for Raspberry pi
- Table of Contents
- Installation
- Methods
- Examples
- Credits
Installation
> git clone https://github.com/GreenPonik/GreenPonik_OneWire_DS18B20.git
from GreenPonik_OneWire_DS18B20.GreenPonik_OneWire_DS18B20 import read_temps
Methods
"""
Get temperatues in celcius and fahrenheit
"""
def read_temps():
Example
import time
from GreenPonik_OneWire_DS18B20.GreenPonik_OneWire_DS18B20 import read_temps
if __name__ == "__main__":
while True:
# read both celcius and fahrenheit temperatures
temperatures = read_temps()
print("celcius temp %.3f" % temperatures[0])
print("fahrenheit temp %.3f" % temperatures[1])
time.sleep(1)
pass
Credits
Write by Mickael Lehoux, from GreenPonik, 2019
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for greenponik-onewire-ds18b20-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f2e783077fafffe3d43a6c2fbe3b157459b05f5c46565f56ba9a347cc277eb9 |
|
MD5 | 8645cad801ea2e76edc195bfa63c4fed |
|
BLAKE2b-256 | 64e227e210a851350459cdcf0b1b0006256689c22f48253a96ee80f2e899139f |
Close
Hashes for greenponik_onewire_ds18b20-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fd9b02cf8c55beff63532a7f9d621c4268157a773f7c7c4919a9cfa20562b88 |
|
MD5 | b62078f3fbb611ae516d2001075cf6a4 |
|
BLAKE2b-256 | 5daf3934a6c186d68d5540373c012891b1343b27ef5fb8c9df670e6040b39926 |