Spectral Triad (AS7265x) Hookup Guide
AS7265x Arduino Library Overview
We’ve written an Arduino library to make reading the Triad a breeze. The easiest way to install the library is by searching SparkFun Spectral Triad within the Arduino library manager. You can also manually install the AS7265x library by downloading a zip:
Example 1 provided with the library demonstrates how to read all 18 channels. The higher examples demonstrate all the features available through the SparkFun library on the Spectral Triad:
- Example 1 - Basic readings of all 18 channels
- Example 2 - Controlling the onboard LEDs
- Example 3 - Changing the many settings on the AS7652x
- Example 4 - Output the raw sensor readings without calibration adjustment
- Example 5 - Setting the sensor up for maximum read speed
- Example 6 - Reading the temperatures of the three ICs
- Example 7 - Reading the various hardware and firmware versions
Below are the various functions that can be called from the library. Most of these functions are demonstrated in the examples so we recommend you go through each example first.
boolean begin(TwoWire &wirePort = Wire);
-- Inits the sensor with default settings. Optional pass of wire port.boolean isConnected();
-- Returns true if the sensor is detected on the I2C busboolean dataAvailable();
-- Returns true when data is availableuint8_t getTemperature(uint8_t deviceNumber = 0);
-- Get temp in C of the master ICfloat getTemperatureAverage();
-- Get average of all three ICsvoid takeMeasurements();
-- Tell sensor to take one-shot measurementvoid takeMeasurementsWithBulb();
-- Take one-shot measurement with all three LEDs illuminatedfloat getCalibratedA();
togetCalibratedW();
-- Returns the various calibration datauint16_t getA();
togetW();
-- Get the various raw readingsvoid enableIndicator();
-- Enable the blue status LEDvoid disableIndicator();
-- Disable the status LED. Handy when taking snesitive readingsvoid enableBulb(uint8_t device);
-- Turn on a given LED. 0 = White, 1 = IR, 2 = UVvoid disableBulb(uint8_t device);
-- Turn off a given LEDvoid setGain(uint8_t gain);
-- 1 to 64xvoid setMeasurementMode(uint8_t mode);
-- 4 channel, other 4 channel, 6 chan, or 6 chan one shotvoid setIntegrationCycles(uint8_t cycleValue);
-- 2.78ms to 711msvoid setBulbCurrent(uint8_t current, uint8_t device);
-- 12.5mA to 100mAvoid setIndicatorCurrent(uint8_t current);
-- 1 to 8mAvoid enableInterrupt();
-- Enable the interrupt pin (active low)void disableInterrupt();
void softReset();
-- Reset the device via softwareuint8_t getDeviceType();
-- Should return 0x41uint8_t getHardwareVersion();
-- Should return 0x40uint8_t getMajorFirmwareVersion();
-- Returns the current firmware version, currently 0x0Cuint8_t getPatchFirmwareVersion();
uint8_t getBuildFirmwareVersion();