View on GitHub

GreenPonik_TSL2561

Read TSL2561 through Python3 on raspberry pi

Quality Gate Status Maintainability Rating

Lines of Code Duplicated Lines (%)

Reliability Rating Security Rating Vulnerabilities

Upload Python Package Python package

GreenPonik_TSL2561.py Library for Raspberry pi


This is the sample code for read light with TSL2561 sensor.

Table of Contents

Installation

> git clone https://github.com/GreenPonik/GreenPonik_TSL2561.git
cd GreenPonik_TSL2561
pip3 install -r requirements.txt

or 

> pip3 install greenponik-tsl2561

from GreenPonik_TSL2561 import GreenPonik_TSL2561

Methods

"""
Get light data
"""
def read_tsl2561():

Example

import time
from GreenPonik_TSL2561 import GreenPonik_TSL2561

if __name__ == "__main__":
    tsl = GreenPonik_TSL2561()
    while True:
        data = tsl.read_tsl2561()
        print(data)
        time.sleep(1)

Credits

Write by Mickael Lehoux, from GreenPonik, 2019