Opt3001
Python support library for the light sensor OPT3001 from Texas Instruments
Description
Contents
Install
- sudo apt-get install -y python-smbus
- pip install opt3001
Usage
import opt3001 from opt3001
address = 0x44
opt = opt3001.OPT3001(address)
# Configure to run in Continuous conversions mode
opt3001.write_config_reg(opt3001.I2C_LS_CONFIG_CONT_FULL_800MS)
while(True):
print(opt3001.read_lux_float())
time.sleep(1)
Raspberry pi
Add following line to /etc/modules to start i2c module on startup:
i2c_dev
Run following commands to start the i2c modules manually:
$ modprobe i2c-bcm2708
$ modprobe i2c_dev
Install i2c-tools to test with the terminal
$ sudo apt-get install i2c-tools
Run following command to get the address of the opt3001
$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Run the following command to test the opt30001
$ i2cget -y 1 0x44 0x00
0x0b
Flight Manual
Constants
OPT3001
constructor(address, bus = 1)
write_config_reg()
read_lux_fixpoint()
read_lux_float
Development
Build
python setup.py sdist bdist_wheel
Upload
twine upload dist/*
Team
- Thomas Pöhlmann (@perryrh0dan)
Licence
This repository was generated by charon
Metadata
Release files for opt3001 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| opt3001-1.1.4.tar.gz | 3.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opt3001-1.1.4-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 6.3 kB
Release files / opt3001-1.1.4.tar.gz
| Download URL | opt3001-1.1.4.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8183808c1a9fc3af2e2f61b939729b7a30615e3e293a56105664862667a7e635
|
|
BLAKE2b-256 checksum How to use checksums |
ef022c93173f15c8fa53f64d08649b5ad2799c165ff53f8b4ab39a0e3abbf8b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5
|
Release files / opt3001-1.1.4-py2-none-any.whl
| Download URL | opt3001-1.1.4-py2-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
91bb034f3e1b0bd2ab3d9985d811d16496f6a4cb03586154fdcb9a71b36af20c
|
|
BLAKE2b-256 checksum How to use checksums |
23f99d5d134c99be3b1fdc6537fbbcfa60b8ce7eda34c7bb7bc8479d8786984b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5
|
Security for opt3001 1.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.