Difference between revisions of "Component: Colour Sensor (EBM018) (EBM Modules)"
(XML import - Pre 8.0 release) |
|||
Line 21: | Line 21: | ||
==Examples== | ==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}} | ||
Revision as of 09:41, 22 October 2018
Author | Matrix TSL |
Version | 1.1 (Release) |
Category | EBM Modules |
Contents
Colour Sensor (EBM018) 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.
Examples
Sample program using the EBM018 - Colour sensor
Sets filter to RGB and W and reads values,displays on LCD
Downloadable macro reference
SetConfig
Sends the config data byte to the sensor using clock and data pins
Parameters
- BYTE Data
Return value
- This call does not return a value
SetLEDOn
Turn on the White LEDs
Parameters
- This macro has no parameters
Return value
- This call does not return a value
SetFrequencyRange
Dynamically change the sensor output frequency range to a new setting
Parameters
- BYTE Freq
- Percentage range (2,20,100)
Return value
- This call does not return a value
GetFrequency
Samples and returns the sensor output frequency (Hz)
Parameters
- This macro has no parameters
Return value
SetFilter
Dynamically change the sensor filter to RGB or W.
Red = 0
Green = 1
Blue = 2
White = 3
Parameters
- BYTE FilterColour
- Filter Colour; Red = 0, Green = 1, Blue = 2 and White = 3
Return value
- This call does not return a value
SetLEDOff
Turn off the White LEDs
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Initialise
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
SDA
This property is of type Single digital pin and can be referenced with the variable name SDA.
Pin used for sending serial configuration data to the sensor device
SCL
This property is of type Single digital pin and can be referenced with the variable name SCL.
Pin used as clock pin for sending serial configuration data to the sensor device
Sensor Output
This property is of type Single digital pin and can be referenced with the variable name OP.
Pin used to monitor the output frequency from the light sensor
Output Frequency Range
This property is of type Fixed list of ints and can be referenced with the variable name FRQ.
Initial sensor output frequency range selection.
100% 0-500KHz
20% 0-100KHz
2% 0-10KHz
Filter Option
This property is of type Fixed list of ints and can be referenced with the variable name FILTER.
Initial filter selected
LED Control
This property is of type Fixed list of ints and can be referenced with the variable name LED.
Initial White LED state
Sample Time Period
This property is of type Fixed list of ints and can be referenced with the variable name SAMPLE.
Length of time period used to sample the sensor frequency (longer is more accurate)