Jump to content

Component: Colour Sensor (EBM018) (EBM Modules): Difference between revisions

From Flowcode Help
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead""
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(One intermediate revision by the same user not shown)
Line 80: Line 80:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFrequency'''
| width="90%" class="mtx-class-macrohead" | '''GetFrequency'''
|-
|-
| colspan="2" | Samples and returns the sensor output frequency (Hz) 
| colspan="2" | Samples and returns the sensor output frequency (Hz) 
Line 94: Line 94:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Initialise the sensor configuration as set by the component properties 
| colspan="2" | Initialise the sensor configuration as set by the component properties 
Line 108: Line 108:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetConfig'''
| width="90%" class="mtx-class-macrohead" | '''SetConfig'''
|-
|-
| colspan="2" | Sends the config data byte to the sensor using clock and data pins 
| colspan="2" | Sends the config data byte to the sensor using clock and data pins 
Line 127: Line 127:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFilter'''
| 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 
| colspan="2" | Dynamically change the sensor filter to RGB or W. Red = 0 Green = 1 Blue = 2 White = 3 
Line 146: Line 146:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFrequencyRange'''
| width="90%" class="mtx-class-macrohead" | '''SetFrequencyRange'''
|-
|-
| colspan="2" | Dynamically change the sensor output frequency range to a new setting 
| colspan="2" | Dynamically change the sensor output frequency range to a new setting 
Line 165: Line 165:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLEDOff'''
| width="90%" class="mtx-class-macrohead" | '''SetLEDOff'''
|-
|-
| colspan="2" | Turn off the White LEDs 
| colspan="2" | Turn off the White LEDs 
Line 179: Line 179:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLEDOn'''
| width="90%" class="mtx-class-macrohead" | '''SetLEDOn'''
|-
|-
| colspan="2" | Turn on the White LEDs 
| colspan="2" | Turn on the White LEDs 
Line 193: Line 193:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

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

EBM018 Example







Macro reference

GetFrequency

GetFrequency
Samples and returns the sensor output frequency (Hz) 
- UINT Return


Initialise

Initialise
Initialise the sensor configuration as set by the component properties 
- VOID Return


SetConfig

SetConfig
Sends the config data byte to the sensor using clock and data pins 
- BYTE Data
 
- VOID Return


SetFilter

SetFilter
Dynamically change the sensor filter to RGB or W. Red = 0 Green = 1 Blue = 2 White = 3 
- BYTE FilterColour
Filter Colour; Red = 0, Green = 1, Blue = 2 and White = 3 
- VOID Return


SetFrequencyRange

SetFrequencyRange
Dynamically change the sensor output frequency range to a new setting 
- BYTE Freq
Percentage range (2,20,100) 
- VOID Return


SetLEDOff

SetLEDOff
Turn off the White LEDs 
- VOID Return


SetLEDOn

SetLEDOn
Turn on the White LEDs 
- VOID Return


Property reference

Properties
SDA
Pin used for sending serial configuration data to the sensor device 
SCL
Pin used as clock pin for sending serial configuration data to the sensor device 
Sensor Output
Pin used to monitor the output frequency from the light sensor 
Output Frequency Range
Initial sensor output frequency range selection. 100% 0-500KHz 20% 0-100KHz 2% 0-10KHz 
Filter Option
Initial filter selected 
LED Control
Initial White LED state 
Sample Time Period
Length of time period used to sample the sensor frequency (longer is more accurate)