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

From Flowcode Help
Jump to navigationJump to search
Line 17: Line 17:
 
==Component Source Code==
 
==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 download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/EBM018v2.fcfx FC_Comp_Source_temp/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]
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/EBM018v2.fcfx FC_Comp_Source_temp/EBM018v2.fcfx]
  
 
==Detailed description==
 
==Detailed description==
Line 62: Line 62:
  
 
{{Fcfile|EBM018 - Test Program.fcfx|EBM018 Example}}
 
{{Fcfile|EBM018 - Test Program.fcfx|EBM018 Example}}
 +
 +
  
  
Line 70: Line 72:
 
==Macro reference==
 
==Macro reference==
  
===SetConfig===
+
===GetFrequency===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetConfig'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFrequency'''
 
|-
 
|-
| colspan="2" | Sends the config data byte to the sensor using clock and data pins 
+
| colspan="2" | Samples and returns the sensor output frequency (Hz) 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
===SetLEDOn===
+
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLEDOn'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Turn on the White LEDs 
+
| colspan="2" | Initialise the sensor configuration as set by the component properties 
 
|-
 
|-
 
|-
 
|-
Line 103: Line 100:
  
  
===SetFrequencyRange===
+
===SetConfig===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFrequencyRange'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetConfig'''
 
|-
 
|-
| colspan="2" | Dynamically change the sensor output frequency range to a new setting 
+
| 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="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Freq
+
| width="90%" | Data
 
|-
 
|-
| colspan="2" | Percentage range (2,20,100) 
+
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 122: Line 119:
  
  
===GetFrequency===
+
===SetFilter===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFrequency'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFilter'''
 +
|-
 +
| colspan="2" | Dynamically change the sensor filter to RGB or W. Red = 0 Green = 1 Blue = 2 White = 3 
 +
|-
 
|-
 
|-
| colspan="2" | Samples and returns the sensor output frequency (Hz) 
+
| 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-u16-icon.png]] - UINT
+
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
===SetFilter===
+
===SetFrequencyRange===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFilter'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFrequencyRange'''
 
|-
 
|-
| 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 output frequency range to a new setting 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | FilterColour
+
| width="90%" | Freq
 
|-
 
|-
| colspan="2" | Filter Colour; Red = 0, Green = 1, Blue = 2 and White = 3 
+
| colspan="2" | Percentage range (2,20,100) 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 169: Line 171:
  
  
===Initialise===
+
===SetLEDOn===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLEDOn'''
 
|-
 
|-
| colspan="2" | Initialise the sensor configuration as set by the component properties 
+
| colspan="2" | Turn on the White LEDs 
 
|-
 
|-
 
|-
 
|-

Revision as of 12:00, 3 February 2023

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_temp/EBM018v2.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_temp/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

FC6 Icon.png EBM018 Example





Macro reference

GetFrequency

Fc9-comp-macro.png GetFrequency
Samples and returns the sensor output frequency (Hz) 
Fc9-u16-icon.png - UINT Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the sensor configuration as set by the component properties 
Fc9-void-icon.png - VOID Return


SetConfig

Fc9-comp-macro.png SetConfig
Sends the config data byte to the sensor using clock and data pins 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


SetFilter

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


SetFrequencyRange

Fc9-comp-macro.png SetFrequencyRange
Dynamically change the sensor output frequency range to a new setting 
Fc9-u8-icon.png - BYTE Freq
Percentage range (2,20,100) 
Fc9-void-icon.png - VOID Return


SetLEDOff

Fc9-comp-macro.png SetLEDOff
Turn off the White LEDs 
Fc9-void-icon.png - VOID Return


SetLEDOn

Fc9-comp-macro.png SetLEDOn
Turn on the White LEDs 
Fc9-void-icon.png - VOID Return



Property reference

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