VEML3328 - RGBCIR Color Sensor
The VEML3328 driver provides an easy way to interface with the RGBCIR color sensor on the AVR-IoT Cellular Mini development board.
Installation
The code can be found at GitHub. This driver is also available in the Arduino Library Manager.
In Arduino IDE, click on the Tools -> Manage libraries...
dropdown menu. Search for AVR-IoT VEML3328
as depicted in the screenshot below and click install.
Examples
Various examples can be found in the GitHub repo for extracting the color values and configuring the sensor. To get started extracting the RGB color values, the following example provides a starting point:
#include <veml3328.h>
#define SerialDebug Serial3
void setup() {
SerialDebug.begin(115200);
if (Veml3328.begin()) {
SerialDebug.println("Error: could not start VEML3328 library");
}
}
void loop() {
SerialDebug.println();
SerialDebug.printf("Red: %u\r\n", Veml3328.getRed());
SerialDebug.printf("Green: %u\r\n", Veml3328.getGreen());
SerialDebug.printf("Blue: %u\r\n", Veml3328.getBlue());
SerialDebug.printf("IR: %u\r\n", Veml3328.getIR());
SerialDebug.printf("Clear: %u\r\n\r\n", Veml3328.getClear());
delay(2000);
}
API documentation