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

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| 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 (Release)
+
| 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. 
  
==[[File:Component Icon 749afd05_ce22_42cb_b17e_3f424cbca6b0.png|Image]] Colour Sensor (EBM018) component==
+
==Component Pack==
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.
 
  
 +
SENSORS
 +
 +
==Detailed description==
 +
 +
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
  
 
Sample program using the EBM018 - Colour sensor
 
Sample program using the EBM018 - Colour sensor
Line 31: Line 36:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>SetConfig</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Sends the config data byte to the sensor using clock and data pins
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetConfig'''
 +
|-
 +
| colspan="2" | Sends the config data byte to the sensor using clock and data pins&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Data''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLEDOn'''
 +
|-
 +
| colspan="2" | Turn on the White LEDs&nbsp;
 +
|-
 +
|-
 +
| 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 value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFrequencyRange'''
 +
|-
 +
| colspan="2" | Dynamically change the sensor output frequency range to a new setting&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Freq
 +
|-
 +
| colspan="2" | Percentage range (2,20,100)&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:''This call does not return a value''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFrequency'''
 +
|-
 +
| colspan="2" | Samples and returns the sensor output frequency (Hz)&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SetLEDOn</tt></u></span>===
 
Turn on the White LEDs
 
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| 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&nbsp;
 +
|-
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:''This macro has no parameters''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLEDOff'''
 +
|-
 +
| colspan="2" | Turn off the White LEDs&nbsp;
 +
|-
 +
|-
 +
| 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 value'''
 
  
:''This call does not return a value''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
===<span style="font-weight: normal;"><u><tt>SetFrequencyRange</tt></u></span>===
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
Dynamically change the sensor output frequency range to a new setting
+
|-
 +
| colspan="2" | Initialise the sensor configuration as set by the component properties&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Freq''
 
::Percentage range (2,20,100)
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>GetFrequency</tt></u></span>===
 
Samples and returns the sensor output frequency (Hz)
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|UINT]]
 
 
 
===<span style="font-weight: normal;"><u><tt>SetFilter</tt></u></span>===
 
Dynamically change the sensor filter to RGB or W.
 
 
Red = 0
 
 
Green = 1
 
 
Blue = 2
 
 
White = 3
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''FilterColour''
 
::Filter Colour; Red = 0, Green = 1, Blue = 2 and White = 3
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>SetLEDOff</tt></u></span>===
 
Turn off the White LEDs
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Initialise the sensor configuration as set by the component properties
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>SDA</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''SDA''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Pin used for sending serial configuration data to the sensor device
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>SCL</u></span>
+
|-
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''SCL''.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | SDA
Pin used as clock pin for sending serial configuration data to the sensor device
+
|-
 
+
| colspan="2" | Pin used for sending serial configuration data to the sensor device&nbsp;
<span style="font-weight: normal;"><u>Sensor Output</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''OP''.
+
| width="90%" | SCL
 
+
|-
Pin used to monitor the output frequency from the light sensor
+
| colspan="2" | Pin used as clock pin for sending serial configuration data to the sensor device&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Output Frequency Range</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | Sensor Output
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''FRQ''.
+
|-
 
+
| colspan="2" | Pin used to monitor the output frequency from the light sensor&nbsp;
Initial sensor output frequency range selection.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
100% 0-500KHz
+
| width="90%" | Output Frequency Range
 
+
|-
  20% 0-100KHz
+
| colspan="2" | Initial sensor output frequency range selection. 100% 0-500KHz  20% 0-100KHz  2% 0-10KHz&nbsp;
 
+
|-
   2% 0-10KHz
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Filter Option
<span style="font-weight: normal;"><u>Filter Option</u></span>
+
|-
 
+
| colspan="2" | Initial filter selected&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''FILTER''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Initial filter selected
+
| width="90%" | LED Control
 
+
|-
<span style="font-weight: normal;"><u>LED Control</u></span>
+
| colspan="2" | Initial White LED state&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''LED''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Sample Time Period
Initial White LED state
+
|-
 
+
| colspan="2" | Length of time period used to sample the sensor frequency (longer is more accurate)&nbsp;
<span style="font-weight: normal;"><u>Sample Time Period</u></span>
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''SAMPLE''.
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
+
|-
Length of time period used to sample the sensor frequency (longer is more accurate)
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 +
|-
 +
|}

Revision as of 16:23, 7 January 2022

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 Pack

SENSORS

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


Downloadable macro reference

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


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


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


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


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


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


Fc9-comp-macro.png Initialise
Initialise the sensor configuration as set by the component properties 
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) 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations