Skip to main content

Read SHT40 through Python3 on raspberry pi

Project description

Quality Gate Status Maintainability Rating

Lines of Code Duplicated Lines (%)

Reliability Rating Security Rating Vulnerabilities

Upload Python Package Python package

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


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 hashes)

Uploaded Source

Built Distribution

greenponik_sht40-0.0.1-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page