Component: Colour Sensor (EBM018) (EBM Modules): Difference between revisions
Appearance
XML import - Pre 8.0 release |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (16 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{| style="width:50%" | |||
{| | |||
|- | |- | ||
| width="20%" style="color: gray;" | Author | | width="20%" style="color:gray;" | Author | ||
| Matrix TSL | | Matrix TSL | ||
|- | |- | ||
| width="20%" style="color: gray;" | Version | | width="20%" style="color:gray;" | Version | ||
| 1.1 | | 1.1 | ||
|- | |- | ||
| width="20%" style="color: gray;" | Category | | width="20%" style="color:gray;" | Category | ||
| EBM Modules | | EBM Modules | ||
|} | |} | ||
==Colour Sensor component== | |||
This board provides the ability to detect colours using the TCS3200 sensor. It will return RGB and W values, dependent on the colour of the object under test. | |||
== | ==Component Source Code== | ||
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBM018v2.fcfx FC_Comp_Source_EBM018v2.fcfx] | |||
= | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBM018v2.fcfx FC_Comp_Source_EBM018v2.fcfx] | ||
==Detailed description== | |||
''No detailed description exists yet for this component'' | |||
=== | ==Examples== | ||
Sample program using the EBM018 - Colour sensor | |||
Sets filter to RGB and W and reads values,displays on LCD | |||
{{Fcfile|EBM018 - Test Program.fcfx|EBM018 Example}} | |||
==Macro reference== | |||
=== | ===GetFrequency=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''GetFrequency''' | |||
|- | |||
| colspan="2" | Samples and returns the sensor output frequency (Hz) | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
:'' | ===Initialise=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''Initialise''' | |||
|- | |||
| colspan="2" | Initialise the sensor configuration as set by the component properties | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
'''Return | ===SetConfig=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''SetConfig''' | |||
|- | |||
| colspan="2" | Sends the config data byte to the sensor using clock and data pins | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Data | |||
|- | |||
| colspan="2" | | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
===SetFilter=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''SetFilter''' | |||
|- | |||
| colspan="2" | Dynamically change the sensor filter to RGB or W. Red = 0 Green = 1 Blue = 2 White = 3 | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | FilterColour | |||
|- | |||
| colspan="2" | Filter Colour; Red = 0, Green = 1, Blue = 2 and White = 3 | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
== | ===SetFrequencyRange=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''SetFrequencyRange''' | |||
|- | |||
| colspan="2" | Dynamically change the sensor output frequency range to a new setting | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Freq | |||
|- | |||
| colspan="2" | Percentage range (2,20,100) | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
===SetLEDOff=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''SetLEDOff''' | |||
|- | |||
| colspan="2" | Turn off the White LEDs | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
===SetLEDOn=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''SetLEDOn''' | |||
|- | |||
| colspan="2" | Turn on the White LEDs | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
==Property reference== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
Pin used as clock pin for sending serial configuration data to the sensor device | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" class="mtx-class-macrohead" | '''Properties''' | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | |||
| width="90%" | SDA | |||
Pin used to monitor the output frequency from the light sensor | |- | ||
| colspan="2" | Pin used for sending serial configuration data to the sensor device | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | |||
| width="90%" | SCL | |||
|- | |||
Initial sensor output frequency range selection. | | colspan="2" | Pin used as clock pin for sending serial configuration data to the sensor device | ||
|- | |||
100% 0-500KHz | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| width="90%" | Sensor Output | |||
20% 0-100KHz | |- | ||
| colspan="2" | Pin used to monitor the output frequency from the light sensor | |||
2% 0-10KHz | |- | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |||
| width="90%" | Output Frequency Range | |||
|- | |||
| colspan="2" | Initial sensor output frequency range selection. 100% 0-500KHz 20% 0-100KHz 2% 0-10KHz | |||
|- | |||
Initial filter selected | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| width="90%" | Filter Option | |||
|- | |||
| colspan="2" | Initial filter selected | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |||
Initial White LED state | | width="90%" | LED Control | ||
|- | |||
| colspan="2" | Initial White LED state | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |||
| width="90%" | Sample Time Period | |||
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) | |||
|} | |||
Latest revision as of 14:23, 13 July 2026
| Author | Matrix TSL |
| Version | 1.1 |
| Category | EBM Modules |
Colour Sensor component
This board provides the ability to detect colours using the TCS3200 sensor. It will return RGB and W values, dependent on the colour of the object under test.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_EBM018v2.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_EBM018v2.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Sample program using the EBM018 - Colour sensor
Sets filter to RGB and W and reads values,displays on LCD
Macro reference
GetFrequency
| GetFrequency | |
| Samples and returns the sensor output frequency (Hz) | |
| Return | |
Initialise
| Initialise | |
| Initialise the sensor configuration as set by the component properties | |
| Return | |
SetConfig
| SetConfig | |
| Sends the config data byte to the sensor using clock and data pins | |
| Data | |
| Return | |
SetFilter
| SetFilter | |
| Dynamically change the sensor filter to RGB or W. Red = 0 Green = 1 Blue = 2 White = 3 | |
| FilterColour | |
| Filter Colour; Red = 0, Green = 1, Blue = 2 and White = 3 | |
| Return | |
SetFrequencyRange
| SetFrequencyRange | |
| Dynamically change the sensor output frequency range to a new setting | |
| Freq | |
| Percentage range (2,20,100) | |
| Return | |
SetLEDOff
| SetLEDOff | |
| Turn off the White LEDs | |
| Return | |
SetLEDOn
| SetLEDOn | |
| Turn on the White LEDs | |
| Return | |