Teensiduino sketch for Vishay's VEML6040 RGBW color sensor
Demonstrate basic VEML6040 functionality including parameterizing the register addresses, initializing the sensor, getting properly scaled rgbw intensity data out. Sketch runs on the 3.3 V Teensy 3.1.
From the data sheet: (https://www.vishay.com/docs/84276/veml6040.pdf)
VEML6040 color sensor senses red, green, blue, and white light and incorporates photodiodes, amplifiers,
and analog / digital circuits into a single chip using CMOS process. With the color sensor applied,
the brightness, and color temperature of backlight can be adjusted base on ambient light source
that makes panel looks more comfortable for end user’s eyes. VEML6040’s adoption of FiltronTM
technology achieves the closest ambient light spectral sensitivity to real human eye responses.
VEML6040 provides excellent temperature compensation capability for keeping the output stable
under changing temperature. VEML6040’s function are easily operated via the simple command format
of I2C (SMBus compatible) interface protocol. VEML6040’s operating voltage ranges from 2.5 V to
3.6 V. VEML6040 is packaged in a lead (Pb)-free 4 pin OPLGA package which offers the best market-proven reliability.
Breakout board for sale at Tindie.