TCS3771 is a RGBC sensor: it can detect Red, Green, Blue and clear light. The IC performs well under a variety of lighting conditions. For example, it can be covered with different attenuation materials.
As a proximity sensor it has a large dynamic range of operation. It can take short distance measurements behind dark glass; or it can be configured for longer distance measurement, for example, human presence detection in front of monitors or laptops.
For power-saving, TCS3771 has an internal state machine that can put the device into a low power mode between successive RGBC and proximity measurements.
TCS3771 is also fast enough to give off proximity information at a high rate of repetition. This makes it useful for proximity detection in portable devices (such as a phone coming near to a speaker’s ear).
Color 3 click communicates with the target MCU through the mikroBUS™ I2C interface, with additional functionality provided by an INT pin. Designed to use a 3.3 power supply only.
Type | Optical |
Applications | RGBC color sensing and proximity sensing (suitable for portable devices) |
On-board modules | TCS3771 color sensor, Infrared LED |
Key Features | RGBC color sensing and proximity detectio |
Key Benefits | Power-saving options, Fast operation (suitable for proximity detection in portable devices), Proximity detection for short or longer ranges |
Interface | GPIO,I2C |
Input Voltage | 3.3V |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
The following code snippet shows how to send temperature readings from Color 3 click to a TFT display.
1 void main() 2 { 3 //Local Declarations 4 uint8_t _i2c_address = 0x29; 5 color_t my_color; 6 7 // GPIOs 8 GPIO_Digital_Input( &GPIOD_BASE, _GPIO_PINMASK_10 ); 9 Delay_ms(300); 10 11 // I2C 12 I2C1_Init_Advanced( 100000, &_GPIO_MODULE_I2C1_PB67 ); 13 Delay_ms(300); 14 15 //Color 3 16 color_3_init( _i2c_address ); 17 Delay_ms(300); 18 19 color_3_get_rgb_data( &my_color ); 20 21 while(1) 22 { 23 24 } 25 }
Code examples that demonstrate the usage of Color 3 click with MikroElektronika hardware, written for mikroC for ARM, AVR, dsPIC, FT90x, PIC and PIC32 are available on Libstock