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.BH1750 import BH1750

Methods

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

Example

import time
from GreenPonik_BH1750.BH1750 import BH1750

if __name__ == "__main__":
    try:
        bh = 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.6.tar.gz (162.3 kB view details)

Uploaded Source

Built Distribution

greenponik_bh1750-0.0.6-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: greenponik-bh1750-0.0.6.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.49.0 CPython/3.8.5

File hashes

Hashes for greenponik-bh1750-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6d4c9d387c838765d6b5cfbb3691a33210cc5f9c27947d915433b131a0d0e02a
MD5 939886ba773c01d8c394647bbff068b4
BLAKE2b-256 0e80e7a364a9c79d99090f81c19581c5f42bbb23a2a4be08c9f2bbab62df6355

See more details on using hashes here.

File details

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

File metadata

  • Download URL: greenponik_bh1750-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.49.0 CPython/3.8.5

File hashes

Hashes for greenponik_bh1750-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2154f8d9ed690379d647c5a7c3a5eadad229a0a8e707b81635bf6e27d5a79e14
MD5 f53e48debf96e7cb848a9ac07d5b09f7
BLAKE2b-256 6f6c1717f8bda209954142f8373c47b10b0b13da4e090bd78dc2fec21aa0e5ce

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