
© Parallax, Inc.
TCS3200-DB (January 21, 2010)
Page 3 of 7
Now, assuming you're using the MoBoStamp-pe, key the following BS2pe program into the BASIC Stamp
Editor. (A similar program, along with programs for different BASIC Stamp versions is available for
download at
www.parallax.com
on the TCS3200-DB product page.)
'{$STAMP BS2pe}
Out CON 7
S3 CON 0
S2 CON 1
LED CON 5
pRED CON 15
pGREEN CON 12
pBLUE CON 9
RED VAR Word
GREEN VAR Word
BLUE VAR Word
Start:
HIGH LED
MainLp:
GOSUB Color
DEBUG "R", DEC3 RED
DEBUG " G", DEC3 GREEN
DEBUG " B", DEC3 BLUE
DEBUG CR
GOTO MainLp
Color:
LOW S2
LOW S3
COUNT Out, pRED, RED
HIGH S3
COUNT Out, pBLUE, BLUE
HIGH S2
COUNT Out, pGREEN, GREEN
RETURN
Next, connect the motherboard to your PC, and Run the program you've entered. Two things should now
happen: 1) the white LEDs on the sensor module will come on, and 2) you will see output appear in the
debug window that looks something like this:
R123 G065 B200
R120 G060 B187
etc.
These numbers are relative values for the red, green, and blue components of the color the sensor is
looking at. With the TCS3200-DB perched on its legs atop a piece of white paper, you will notice that the
LEDs form a bright spot of light in front of the lens. You may need to adjust the LEDs or the height a bit
to make sure that the spots from both LEDs merge into a single round spot.
Hardware Notes
No technical discussion of the TCS3200 sensor module set would be complete without the material
contained in the TAOS TCS3200 datasheet. If you do not have this datasheet, you are encouraged to
download it from the TAOS website,
www.taosinc.com
.