Difference: TCS3200 (5 vs. 6)

Revision 62022-05-23 - UliRaich

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

TCS3200 Color Sensor

Introduction

Line: 98 to 97
 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

Changed:
<
<
-- Uli Raich - 2022-05-16
>
>
Once the calibration is done, we have all the tools needed to measure rgb values. We must use the methods that were used to measure the frequencies for black and white targets for the measurement of colored targets. The rgb values are calculated with the formula shown in the calibration section.

In order to check the validity of the measurements, we can display the rgb values on the WS2812 LED ring. The rgb.py test program does exactly this. Place a colored target in front of the TCS3200 and the same color will be displayed on the WS2812 LED ring.

The driver

Finally, the application can be separated from the driver part and stored in a file named tcs3200.py. This file must be copied to the ESP32 (I use its lib directory).

from tcs3200 import TCS3200

imports the class with all its methods and its class variables. Now we can re-write all our test programs as short applications, making use of the driver. This essentially means to just copy the main part of the test programs into separate files. You find the driver on the github repository in the folder name driver.

 

Comments

<--/commentPlugin-->
 
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