Difference between revisions of "Crowtail- I2C Color Sensor"
(Created page with "== Description == Usually 4 digit display module is a 12 pin module. But in our Crowtail gadget, we utilize a TM1637 to scale down the controlling pins into 2 Crowtail pins....") |
|||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
− | + | This module is based on the color sensor TCS3414CS with digital output I2C. Based on the 8*2 array of filtered photodiodes and 16-bits analog-to-digital converters, you can gain the color chromaticity of ambient light or the color of objects. Of the 16 photodiodes, 4 have red filters, 4 have green filters, 4 have blue filters and 4 have no filter(clear). With the synchronization input pin, external pulsed light source can provides precise synchronous conversion control. | |
− | '''Model: [ | + | '''Model: [http://www.elecrow.com/crowtail-i2c-color-sensor-p-1523.html CT0067ICS]'''<br> |
− | [[File:Crowtail- | + | [[File:Crowtail- I2C Color Sensor2.JPG|400px]] |
− | == | + | == Specification == |
− | * | + | *Crowtail compatible interface |
− | * | + | *16-Bit digital output with I 2C at 400 kHz |
− | * | + | *SYNC Input Synchronizes Integration Cycle to Modulated Light Sources |
− | *Dimensions(mm): | + | *Operating temperature range -40°C to 85°C |
− | + | *Programmable interrupt function with User-Defined Upper and lower threshold settings | |
− | + | *Dimensions(mm):20.0(L)x20.0(W)x13.6(H) | |
− | |||
− | |||
− | |||
== Usage == | == Usage == | ||
− | + | ||
− | + | [[File:Crowtail- I2C Color Sensor1.jpg |600px]] | |
− | |||
− | [[File:Crowtail- | ||
− | + | 1.Download [http://www.elecrow.com/wiki/index.php?title=File:I2C_Color_Sensor1.zip Crowtail- I2C Color Sensor library]; Unzip and put it in the libraries file : ..\arduino-1.0\libraries; | |
− | + | 2.Open "colorview" example via the path: File --> Examples --> Adafruit TCS34725 -->colorview. | |
<pre> | <pre> | ||
− | / | + | #include <Wire.h> |
− | + | //#include <math.h> | |
− | + | #include <IICColorSensor.h> | |
− | + | ||
− | #include | ||
− | #include < | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
void setup() | void setup() | ||
{ | { | ||
− | + | Serial.begin(9600); | |
+ | Wire.begin(); | ||
} | } | ||
void loop() | void loop() | ||
{ | { | ||
− | + | int red, green, blue; | |
− | + | IICColorSensor colorSensor; | |
− | + | colorSensor.ledStatus = 1; // When turn on the color sensor LED, ledStatus = 1; When turn off the color sensor LED, ledStatus = 0. | |
− | + | while(1) | |
− | + | { | |
− | + | colorSensor.readRGB(&red, &green, &blue); //Read RGB values to variables. | |
− | + | delay(300); | |
− | + | Serial.print("The RGB value are: RGB( "); | |
− | + | Serial.print(red,DEC); | |
− | + | Serial.print(", "); | |
− | + | Serial.print(green,DEC); | |
− | + | Serial.print(", "); | |
− | + | Serial.print(blue,DEC); | |
− | + | Serial.println(" )"); | |
+ | colorSensor.clearInterrupt(); | ||
+ | } | ||
}</pre> | }</pre> | ||
− | + | 3.Upload it into your Arduino board and have a test. | |
− | |||
− | |||
== Resource == | == Resource == | ||
− | *[http://www.elecrow.com/wiki/index.php?title=File: | + | *[http://www.elecrow.com/wiki/index.php?title=File:I2C_Color_Sensor1.zip Crowtail- I2C Color Sensor Program] |
− | *[http://www.elecrow.com/wiki/index.php?title=File:Crowtail- | + | *[http://www.elecrow.com/wiki/index.php?title=File:Crowtail-_I2C_Color_Sensor_eagle_files.zip Crowtail- I2C Color Sensor eagle files] |
Latest revision as of 06:07, 22 August 2019
Contents
Description
This module is based on the color sensor TCS3414CS with digital output I2C. Based on the 8*2 array of filtered photodiodes and 16-bits analog-to-digital converters, you can gain the color chromaticity of ambient light or the color of objects. Of the 16 photodiodes, 4 have red filters, 4 have green filters, 4 have blue filters and 4 have no filter(clear). With the synchronization input pin, external pulsed light source can provides precise synchronous conversion control.
Model: CT0067ICS
Specification
- Crowtail compatible interface
- 16-Bit digital output with I 2C at 400 kHz
- SYNC Input Synchronizes Integration Cycle to Modulated Light Sources
- Operating temperature range -40°C to 85°C
- Programmable interrupt function with User-Defined Upper and lower threshold settings
- Dimensions(mm):20.0(L)x20.0(W)x13.6(H)
Usage
1.Download Crowtail- I2C Color Sensor library; Unzip and put it in the libraries file : ..\arduino-1.0\libraries;
2.Open "colorview" example via the path: File --> Examples --> Adafruit TCS34725 -->colorview.
#include <Wire.h> //#include <math.h> #include <IICColorSensor.h> void setup() { Serial.begin(9600); Wire.begin(); } void loop() { int red, green, blue; IICColorSensor colorSensor; colorSensor.ledStatus = 1; // When turn on the color sensor LED, ledStatus = 1; When turn off the color sensor LED, ledStatus = 0. while(1) { colorSensor.readRGB(&red, &green, &blue); //Read RGB values to variables. delay(300); Serial.print("The RGB value are: RGB( "); Serial.print(red,DEC); Serial.print(", "); Serial.print(green,DEC); Serial.print(", "); Serial.print(blue,DEC); Serial.println(" )"); colorSensor.clearInterrupt(); } }
3.Upload it into your Arduino board and have a test.