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

Uploaded Source

Built Distribution

greenponik_bh1750-0.0.7-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: greenponik-bh1750-0.0.7.tar.gz
  • Upload date:
  • Size: 162.6 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.50.0 CPython/3.8.5

File hashes

Hashes for greenponik-bh1750-0.0.7.tar.gz
Algorithm Hash digest
SHA256 c03556aec6035b8b5e83e18e3cbb3cc31f7c5882d5e9f2af99f8a48ab4df1ebf
MD5 595539d6f7105dfb5469eeae8cd43fc5
BLAKE2b-256 7fb87e0a9c36f57da4a4dfe56b81b28eca52a3772fc80504c121800889370de2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for greenponik_bh1750-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5d7decce3b20e85b8ef89c191f784dab870785161808f809272fa0ca88206ccc
MD5 ce567d0471e6568c57bc683951ccc9ef
BLAKE2b-256 c8373ca8a6cf94aeeffb26107255827f67dac653da450925009d6472d5b7f1a1

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