I2C drivers for the lux sensor

The drivers are available from the GitHub repository for the Sensorian hardware (https://github.com/sensorian/sensorian-firmware.git). Let's clone the repository from the command-line terminal:

    git clone https://github.com/sensorian/sensorian-firmware.git 

Let's make use of the drivers (which is available in the  ~/sensorian-firmware/Drivers_Python/APDS-9300 folder) to read the values from the two ADC channels of the sensor:

import time import APDS9300 as LuxSens import sys AmbientLight = LuxSens.APDS9300() while True:    time.sleep(1)    channel1 = AmbientLight.readChannel(1)                          channel2 = AmbientLight.readChannel(0)    Lux = AmbientLight.getLuxLevel(channel1,channel2)    print("Lux output: %d." % Lux)

With the ADC ...

Get Python Programming with Raspberry Pi now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.