Difference between revisions of "Component: Colour Sensor (Grove 101020341) (101020341) (Light)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...") |
|||
Line 15: | Line 15: | ||
Based on the color sensor TCS34725FN 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. | Based on the color sensor TCS34725FN 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. | ||
− | ==Component | + | ==Component Source Code== |
− | + | Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_I2C_Colour_Sensor.fcfx FC_Comp_Source_I2C_Colour_Sensor.fcfx] | |
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
''No detailed description exists yet for this component'' | ''No detailed description exists yet for this component'' | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 212: | Line 216: | ||
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Sensor Settings | ||
|- | |- | ||
|- | |- | ||
Line 223: | Line 231: | ||
|- | |- | ||
| colspan="2" | Length of time period used to sample the sensor frequency (longer is more accurate) | | colspan="2" | Length of time period used to sample the sensor frequency (longer is more accurate) | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I2C Settings | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
Line 254: | Line 266: | ||
| colspan="2" | Pin used for SCL (clock signal) | | colspan="2" | Pin used for SCL (clock signal) | ||
|- | |- | ||
− | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | |
− | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="background-color:# | ||
− | | width="90%" style="background-color:# | ||
|- | |- | ||
|- | |- |
Revision as of 17:47, 9 November 2022
Author | Matrix TSL |
Version | 1.0 |
Category | Light |
Contents
Colour Sensor (Grove 101020341) component
Based on the color sensor TCS34725FN 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.
Component Source Code
Please click here for the component source code: FC_Comp_Source_I2C_Colour_Sensor.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
![]() |
SetGain |
Controls the gain. 0x00 = 1X 0x01 = 4X 0x02 = 16X 0x03 = 60X | |
![]() |
Setting |
Range: 0 to 3 | |
![]() |
Return |
![]() |
ClearInterrupt |
Clears the interrupt flag allowing the device to interrupt again. | |
![]() |
Return |
![]() |
CalculateTemp |
Uses the RGB values stored in RAM from the last Sample to calculate the colour temperature in degrees Kelvin. | |
![]() |
Return |
![]() |
EnableSensor |
Powers up the device ready for taking colour readings. | |
![]() |
Return |
![]() |
CalculateLux |
Uses the RGB values stored in RAM from the last Sample to calculate the luminance in lux. | |
![]() |
Return |
![]() |
SampleSensor |
Reads the raw colour channels from the sensor and stores the readings into RAM to be collected by the ReadDataChannel macro. | |
![]() |
Return |
![]() |
DisableSensor |
Powers down the device to save power. | |
![]() |
Return |
![]() |
SetIntegrationTime |
Controls the integration time. 0 = 700mS / 1 = 154mS / 2 = 101mS / 3 = 50mS / 4 = 24mS / 5 = 2.4mS | |
![]() |
Setting |
Range: 0 to 5 | |
![]() |
Return |
![]() |
Initialise |
Initialise the sensor configuration as set by the component properties. Sets the default intigration time and gain as well as enable the sensor. | |
![]() |
Return |