sommersoft/veml6070


CircuitPython Driver For The Adafruit VEML6070 UV Sensor Breakout

License: Other

Language: Python

Keywords: circuitpython


Introduction

Discord

CircuitPython driver for the VEML6070 UV Index Sensor Breakout

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Usage Example

import busio
import veml6070
import time
from board import *

with busio.I2C(SCL, SDA) as i2c:
    uv = veml6070.VEML6070(i2c)
    # Alternative constructors with parameters
    #uv = veml6070.VEML6070(i2c, 'VEML6070_1_T')
    #uv = veml6070.VEML6070(i2c, 'VEML6070_HALF_T', True)

    # take 10 readings
    for j in range(10):
        uv_raw = uv.read
        risk_level = uv.get_index(uv_raw)
        print('Reading: {0} | Risk Level: {1}'.format(uv_raw, risk_level))
        time.sleep(1)

API Reference

.. toctree::
   :maxdepth: 2

   api

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Building locally

To build this library locally you'll need to install the circuitpython-build-tools package.

python3 -m venv .env
source .env/bin/activate
pip install circuitpython-build-tools

Once installed, make sure you are in the virtual environment:

source .env/bin/activate

Then run the build:

circuitpython-build-bundles --filename_prefix circuitpython-veml6070 --library_location .

Project Statistics

Sourcerank 3
Repository Size 31.3 KB
Stars 0
Forks 0
Watchers 0
Open issues 0
Dependencies 1
Contributors 1
Tags 2
Created
Last updated
Last pushed

Top Contributors See all

sommersoft

Recent Tags See all

1.0.0 January 21, 2018
0.0.1 January 20, 2018

Something wrong with this page? Make a suggestion

Last synced: 2018-01-21 03:19:47 UTC

Login to resync this repository