Component: Colour Sensor (TCS3200, EBM018) (Sensors: EBM Modules)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.1 (Release)
Category Sensors: EBM Modules


Image Colour Sensor (TCS3200, 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 FC6 Icon.png EBM018 Example

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

UINT


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)