Difference: TCS3200 (4 vs. 5)

Revision 52022-05-17 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

TCS3200 Color Sensor

Introduction

Line: 83 to 83
  time.sleep_ms(10)

will wait forever, if the number of cycles to be measured, is never reached. This can happen e.g. if the OUT signal is assigned a wrong GPIO pin. The problem can be solved by starting a timeout counter when the measurement is started. This counter can be used to raise an exception if reaching the _cycles limit takes too long.

Added:
>
>
timeout.py is the same program as meas_freq.py with the timeout counter added. The timeout is set to 2s. The number of cycles to be measured is set to 10000 in order to provoke the timeout.
 

Calibration

Added:
>
>
The formula for the calculation of rgb values is given by:

component = max * (Fv - Fb) / (Fw - Fb) where the variables have the following meaning:

  • component: value of the color component measured
  • max: maximum value the color component can reach. For many color representations, this is 0xff or 255
  • Fv: frequency measured for the color component
  • Fb: frequency measured for a black target
  • Fw: frequency measured for a white target
This means that we must measure the frequencies of each color component for a black and a white target. This is done in calibration.py.

Detecting colors

 -- Uli Raich - 2022-05-16

Comments

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback