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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: greenponik-bh1750-0.0.2.tar.gz
  • Upload date:
  • Size: 162.0 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.2.tar.gz
Algorithm Hash digest
SHA256 a6d1f4e5b29e896da4de18f8ae508431a545b17c80fcf41ba4ff675b02f12c01
MD5 d2f3a6c34c3f450916cdee98292199a7
BLAKE2b-256 7ffa83aff82bb9d56e631495fd9e88d52e203c3f169747063eb8c17df0f2c38c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: greenponik_bh1750-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e72c221eb566ccbed0c64594cb4041818e678bc0144110d487ad862f9d32933
MD5 de607dbb80230997ee368db625231cb1
BLAKE2b-256 f6b98f9de44a41d2ebe5c43ffa74c30a2fc4472d3e66eb754f40838496891f5a

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