Skip to main content

Read BH1750 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_BH1750.py Library for Raspberry pi


This is the sample code for read light with BH1750 sensor.

Table of Contents

Installation

> git clone https://github.com/GreenPonik/GreenPonik_BH1750.git
cd GreenPonik_BH1750
pip3 install -r requirements.txt

or 

> pip3 install greenponik-bh1750
from GreenPonik_BH1750 import GreenPonik_BH1750

Methods

"""
Get light data
"""
def read_bh1750():

Example

import time
from GreenPonik_BH1750.GreenPonik_BH1750 import GreenPonik_BH1750

if __name__ == "__main__":
    try:
        bh = GreenPonik_BH1750()
        while True:
            lux = bh.read_bh1750()
            print(lux)
            time.sleep(1)
    except Exception as e:
        print('An exception occurred: {}'.format(e))

Credits

Write by Mickael Lehoux, from GreenPonik, 2019

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-bh1750-0.0.3.tar.gz (162.3 kB view details)

Uploaded Source

Built Distribution

greenponik_bh1750-0.0.3-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file greenponik-bh1750-0.0.3.tar.gz.

File metadata

  • Download URL: greenponik-bh1750-0.0.3.tar.gz
  • Upload date:
  • Size: 162.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for greenponik-bh1750-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7e8de5848dc79d9816dc8d6e63b0b18c18370a201087f8283facc09e30cc4e3f
MD5 8fb4b72ee29ecb1658ab6707d32523c8
BLAKE2b-256 791893e20eac3994b1385ca3a505267e66c122441fd67a27e83cb94e94e9619d

See more details on using hashes here.

File details

Details for the file greenponik_bh1750-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: greenponik_bh1750-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for greenponik_bh1750-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a5d4e53e9d5164ff48c66405f193df15094b24bf45ce3f6d71f5b4b4da6af20c
MD5 dd398825873c7fd0cd97a2454854c18d
BLAKE2b-256 22f0a10d899130d9b8341896845c9c38f78c13c6970e5a07efb6c5c59689c99a

See more details on using hashes here.

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