Adafruit AS726x Arduino Library
Classes | Macros | Enumerations
Adafruit_AS726x.h File Reference
#include "WProgram.h"
#include <Adafruit_I2CDevice.h>

Go to the source code of this file.

Classes

class  Adafruit_AS726x
 Class that stores state and functions for interacting with AS726x spectral sensors. More...
 

Macros

#define AS726x_ADDRESS   (0x49)
 default I2C address
 
#define AS726x_INTEGRATION_TIME_MULT   2.8
 multiplier for integration time
 
#define AS726x_NUM_CHANNELS   6
 number of sensor channels
 

Enumerations

enum  {
  AS726X_HW_VERSION = 0x00, AS726X_FW_VERSION = 0x02, AS726X_CONTROL_SETUP = 0x04, AS726X_INT_T = 0x05,
  AS726X_DEVICE_TEMP = 0x06, AS726X_LED_CONTROL = 0x07, AS7262_V_HIGH = 0x08, AS7262_V_LOW = 0x09,
  AS7262_B_HIGH = 0x0A, AS7262_B_LOW = 0x0B, AS7262_G_HIGH = 0x0C, AS7262_G_LOW = 0x0D,
  AS7262_Y_HIGH = 0x0E, AS7262_Y_LOW = 0x0F, AS7262_O_HIGH = 0x10, AS7262_O_LOW = 0x11,
  AS7262_R_HIGH = 0x12, AS7262_R_LOW = 0x13, AS7262_V_CAL = 0x14, AS7262_B_CAL = 0x18,
  AS7262_G_CAL = 0x1C, AS7262_Y_CAL = 0x20, AS7262_O_CAL = 0x24, AS7262_R_CAL = 0x28
}
 virtual registers
 
enum  {
  AS726X_SLAVE_STATUS_REG = 0x00, AS726X_SLAVE_WRITE_REG = 0x01, AS726X_SLAVE_READ_REG = 0x02, AS726X_SLAVE_TX_VALID = 0x02,
  AS726X_SLAVE_RX_VALID = 0x01
}
 hardware registers
 
enum  {
  AS7262_VIOLET = 0x08, AS7262_BLUE = 0x0A, AS7262_GREEN = 0x0C, AS7262_YELLOW = 0x0E,
  AS7262_ORANGE = 0x10, AS7262_RED = 0x12, AS7262_VIOLET_CALIBRATED = 0x14, AS7262_BLUE_CALIBRATED = 0x18,
  AS7262_GREEN_CALIBRATED = 0x1C, AS7262_YELLOW_CALIBRATED = 0x20, AS7262_ORANGE_CALIBRATED = 0x24, AS7262_RED_CALIBRATED = 0x28
}
 color registers
 
enum  conversion_types { MODE_0 = 0b00, MODE_1 = 0b01, MODE_2 = 0b10, ONE_SHOT = 0b11 }
 conversion modes. Default is Mode 2
 
enum  channel_gain { GAIN_1X = 0b00, GAIN_3X7 = 0b01, GAIN_16X = 0b10, GAIN_64X = 0b11 }
 gain settings. Default is 1x gain
 
enum  ind_led_current_limits { LIMIT_1MA = 0b00, LIMIT_2MA = 0b01, LIMIT_4MA = 0b10, LIMIT_8MA = 0b11 }
 indicator LED current limit settings. Default is 1mA
 
enum  drv_led_current_limits { LIMIT_12MA5 = 0b00, LIMIT_25MA = 0b01, LIMIT_50MA = 0b10, LIMIT_100MA = 0b11 }
 Driver LED current limit settings. Default is 12.5 mA.
 
enum  {
  AS726x_VIOLET = 0, AS726x_BLUE, AS726x_GREEN, AS726x_YELLOW,
  AS726x_ORANGE, AS726x_RED
}
 Color definitions used by the library.
 

Detailed Description

This is a library for the Adafruit AS726x breakout board -—> https://www.adafruit.com/products/3779

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Dean Miller for Adafruit Industries.

BSD license, all text here must be included in any redistribution.