Read BH1750 through Python3 on raspberry pi
Project description
GreenPonik_BH1750.py Library for Raspberry pi
This is the sample code for read light with BH1750 sensor.
Table of Contents
- GreenPonik_BH1750.py Library for Raspberry pi
- Table of Contents
- Installation
- Methods
- Examples
- Credits
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 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.1.tar.gz
(162.6 kB
view details)
Built Distribution
File details
Details for the file greenponik-bh1750-0.0.1.tar.gz
.
File metadata
- Download URL: greenponik-bh1750-0.0.1.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.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f36cb8dda8af6def02cc84da93914b096b6e9d4fcbf9c0b63631b54b328efa3a |
|
MD5 | c9097123dac9ea709ed4a151020e94aa |
|
BLAKE2b-256 | 37f064290f35c312220958eec8e3fedff8fca221751d70ae35e353aa1472ea1b |
File details
Details for the file greenponik_bh1750-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: greenponik_bh1750-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.1 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 630e349fbd3aa1dcbd8232485fedb3f00371f92863712fa41024d3dabc80a833 |
|
MD5 | 0c6aa9cde2dc918d778a3403fe44b508 |
|
BLAKE2b-256 | 9d32d3281f4c8525b3d4d9ad7b3b52c3330940124a93087677969396299ff7d9 |