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.5.tar.gz (162.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: greenponik-bh1750-0.0.5.tar.gz
  • Upload date:
  • Size: 162.4 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.5.tar.gz
Algorithm Hash digest
SHA256 3c653ce761b817c5f11be7d324e93bc2da94e8172ad886f885645a9336b2cf04
MD5 9bda69886a8ecf01c1fe2180c8ea57e4
BLAKE2b-256 79ee3e865299f8f192fed2ac5b02534cfe31afe27e491940c7958a8d7387e52c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: greenponik_bh1750-0.0.5-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.48.2 CPython/3.8.5

File hashes

Hashes for greenponik_bh1750-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c8f67769ef942d4ab1350e0173dc66c38defd47e86bdfffe229628682a7e906b
MD5 baa54e90ff52da445a0b9ffc510de246
BLAKE2b-256 638cd001d95afb9927bf346f8b6a5b9771c2d41ea7e29d016c974c31ac9c8f50

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