Skip to main content

Read TSL2561 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_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

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-tsl2561-0.0.3.tar.gz (162.5 kB view hashes)

Uploaded Source

Built Distribution

greenponik_tsl2561-0.0.3-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

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