TCS230 Sensor using MD_TCS230 library - inconsistent matching values

First off, the MD_TCS230 library is fantastic…very well written (coming from an intermediate programmer’s point of view).

I’m running into an issue though, and I can’t seem to pinpoint why. I’m using the Arduino mega 2560 (so my timer pin is in 47), and I build an all-black chamber surrounding the 4 lights and the sensor. Also, I’m running the “ColorMatch_TCS230.ino” example.

When I run “Learn” mode, everything seems to work fine…the RGB values are actually closely related to the real values (I’m using Lowe’s paint swatches, so I have that RGB info at hand).

However, in “Match” mode, the RGB values read aren’t a) close to the Lowe’s values, and b) close to the calibrated values. So the returned color is not correct.

I have the lights shut off in the room I’m working in, and there’s about 2% of surrounding light seeping into the chamber (2% is what I consider…the thing is shut tight really). I tested the MD_TCS230 initial object with CS(S2_OUT,S3_OUT,OE_OUT) and CS(S2_OUT,S3_OUT,S0_OUT,S1_OUT,OE_OUT), with no luck.

I only take one calibration test for each color, so there’s no average of values…it’s a one-time deal for each.

Any thoughts as to why this occurs? Anything I need to change in the Example program?

Actually, my apologies. After "Learn" mode, I replaced the new color values for colorTable ct[] but never replaced the new black/white frequency every new "match" capture relied on the example black/white boundaries.