Skip to content

TCS34725 — is color detected? (tcs34725_is_col)

What it does: Returns True/False if the library evaluated the selected color (black, white, red, green, blue, yellow).

tcs34725_is_col

Inputs

  • Field rgb_id: selection of initialized sensor.
  • Field col: tested color.

Output

  • Boolean (True/False).

When to use it

  • For making decisions in conditions based on the color of the object.
  • When you don't need exact numerical channels, but only a color category.

Tips and pitfalls

  • The result strongly depends on the light, distance and background color.
  • Before actual deployment, test functionality and exposure time on real objects.

Usage example

example_tcs34725_init

Open example in ESP IDE

Generated Python example

is_red = rgb_sensor1.is_red()