ColourSensor Class

Reports RGB and HSL values detected using TCS34725 I2C sensor. HSL values may give better results when detecting colours. For each colour to detect, obtain reference values with the sensor close to the object, and with the sensor further away. Compare readings against the range of reference values to identify the colour. This feature is only available in the Education Edition of the RoboTx API.

Definition

Namespace: RoboTx.Api
Assembly: RoboTx.Api (in RoboTx.Api.dll) Version: 2.0.0
C#
public sealed class ColourSensor : ContinuousSensor
Inheritance
Object    ContinuousSensor    ColourSensor

Properties

IsEnabled Returns true if the sensor has been enabled.
(Inherited from ContinuousSensor)
IsReady Returns true if the sensor values are available for reading.
(Inherited from ContinuousSensor)

Methods

Disable Stops the colour sensor reporting colour values.
(Overrides ContinuousSensorDisable)
Enable Enables the colour sensor to report colour values, using integration time 50ms and gain of x4. See overloaded method for specifying different integration time and gain values.
(Overrides ContinuousSensorEnable)
Enable(Int32, Int32) Enables the colour sensor to report colour values using specified integration time and gain.
GetHSL Gets the colour as H, S and L values reported by the colour sensor once it has been enabled. How long it takes for colour values to start being reported, and the subsequent reporting interval will depend in the integration time specified in the Enable method.
GetRGBC Gets the red, green, blue and clear values reported by the colour sensor once it has been enabled. How long it takes for colour values to start being reported, and the subsequent reporting interval will depend in the integration time specified in the Enable method.

See Also