Home

Awesome

PiicoDev® VEML6030 MicroPython Module

This is the firmware repo for the Core Electronics PiicoDev® Ambient Light Sensor VEML6030.

This module depends on the PiicoDev Unified Library.

See the Quickstart Guides for:

Usage

Example

main.py is a simple example to get started.

from PiicoDev_VEML6030 import PiicoDev_VEML6030
from time import sleep

# Initialise Sensor
light = PiicoDev_VEML6030()

while True:
    # Read and print light data
    lightVal = light.read()
    print(str(lightVal) + " lux")

    sleep(1)

Details

PiicoDev_VEML6030(bus=, freq=, sda=, scl=, addr=0x10)

ParameterTypeRangeDefaultDescription
busint0,1Raspberry Pi Pico: 0, Raspberry Pi: 1I2C Bus. Ignored on Micro:bit
freqint100-1000000Device dependentI2C Bus frequency (Hz). Ignored on Raspberry Pi
sdaPinDevice DependentDevice DependentI2C SDA Pin. Implemented on Raspberry Pi Pico only
sclPinDevice DependentDevice DependentI2C SCL Pin. Implemented on Raspberry Pi Pico only
addrint0x10, 0x480x10This address needs to match the PiicoDev Ambient Light Sensor VEML6030 hardware address configured by the jumper

PiicoDev_VEML6030.read()

ParameterTypeUnitDescription
returnedfloatluxAmbient light

PiicoDev_VEML6030.setGain(gain)

ParameterTypeRangeDescription
gainfloat/int0.125, 0.5, 1, 2Set the gain of the device. Affects resolution and maximum possible illumination. See the appnote

License

This project is open source - please review the LICENSE.md file for further licensing information.

If you have any technical questions, or concerns about licensing, please contact technical support on the Core Electronics forums.

"PiicoDev" and the PiicoDev logo are trademarks of Core Electronics Pty Ltd.