Read SHT40 through Python3 on raspberry pi
Project description
GreenPonik_SHT40.py Library for Raspberry pi
This is the sample code for read light with SHT40 sensor.
Table of Contents
Installation
> git clone https://github.com/GreenPonik/GreenPonik_SHT40.git
cd GreenPonik_SHT40
pip3 install -r requirements.txt
or
> pip3 install greenponik-sht40
from GreenPonik_SHT40.SHT40 import SHT40
Methods
"""
Get light data
"""
def read_sht40():
Example
import time
from GreenPonik_SHT40.SHT40 import SHT40
if __name__ == "__main__":
try:
sht = SHT40()
while True:
data = sht.read_sht40()
print("temperature: %.2f / humidity: %.2f" % (data[0], data[1]))
time.sleep(1)
except Exception as e:
print('An exception occurred: {}'.format(e))
Credits
Code by Mickael Lehoux, from GreenPonik, 2021
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
greenponik-sht40-0.0.1.tar.gz
(35.6 kB
view details)
Built Distribution
File details
Details for the file greenponik-sht40-0.0.1.tar.gz
.
File metadata
- Download URL: greenponik-sht40-0.0.1.tar.gz
- Upload date:
- Size: 35.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 691238f37e2e0f679e4628c88fad800d499016f299e7879d16cb35a9206c571b |
|
MD5 | 82b4414b929b2904efef7cd55fc8b364 |
|
BLAKE2b-256 | 23f1cc059fffabd928c40d63a556b936b1092ccffd7fc2bd235492d1fb091e52 |
File details
Details for the file greenponik_sht40-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: greenponik_sht40-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e914d9bb7a13244d2c4a7e38ff4f50d725ff1485f99a1dba545c993ff673655 |
|
MD5 | 8035c231706e223d62701913943c1429 |
|
BLAKE2b-256 | b52f80e315d196c0edd7f277b235b70a21d1447d41b38520eeeed6219cce40d2 |