Component: Colour Sensor V3 (Grove 101021133) (101021133) (Light)

From Flowcode Help
Revision as of 08:58, 9 June 2025 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category Light


Colour Sensor V3 (Grove 101021133) component

Based on the color sensor VEML6040 with digital output I2C. senses red, green, blue, and white light and incorporates photodiodes, amplifiers, and analog / digital circuits into a single chip. Provides a spectrum matching real human eye responses.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

CalculateLux

Fc9-comp-macro.png CalculateLux
Uses the RGB values stored in RAM from the last Sample to calculate the luminance in lux. 
Fc9-u16-icon.png - UINT Return


CalculateTemp

Fc9-comp-macro.png CalculateTemp
Uses the RGB values stored in RAM from the last Sample to calculate the colour temperature in degrees Kelvin. 
Fc9-u16-icon.png - UINT Return


DisableSensor

Fc9-comp-macro.png DisableSensor
Powers down the device to save power. 
Fc9-void-icon.png - VOID Return


EnableSensor

Fc9-comp-macro.png EnableSensor
Powers up the device ready for taking colour readings. 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Initialise the sensor configuration as set by the component properties. Sets the default intigration time and gain as well as enable the sensor. Returns 1 if the sensor is detected and responding to commands. 
Fc9-bool-icon.png - BOOL Return


ReadDataChannel

Fc9-comp-macro.png ReadDataChannel
Returns the value of the selected colour channel from the last sample. The Red, Green and Blue channels have a colour filter to remove light of other colours. The Clear channel has no filter allowing the ambient light level to be easily collected. 
Fc9-u8-icon.png - BYTE ColourChannel
Range: 0 to 3 - 0=Red, 1=Green, 2=Blue, 3=Clear 
Fc9-u16-icon.png - UINT Return


SampleSensor

Fc9-comp-macro.png SampleSensor
Reads the raw colour channels from the sensor and stores the readings into RAM to be collected by the ReadDataChannel macro. 
Fc9-void-icon.png - VOID Return


SetIntegrationTime

Fc9-comp-macro.png SetIntegrationTime
Controls the integration time. 0 = 40mS / 1 = 80mS / 2 = 160mS / 3 = 320mS / 4 = 640mS / 5 = 1280mS 
Fc9-u8-icon.png - BYTE Setting
Range: 0 to 5 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Sensor Settings
Fc9-type-16-icon.png Integration Time
Length of time period used to sample the sensor frequency (longer is more accurate) 
Fc9-conn-icon.png I2C Settings
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png Simulation Type
Selects the simulation type for the component. Component GUI - Interacts with the panel to sense the colour of a object in close proximity to the sensor. I2C Injector - Performs the I2C commands allowing you to connect an injector component or view and debug the I2C communications. 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Colour_Sensor_V3_I2C_Grove.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Colour_Sensor_V3_I2C_Grove.fcfx