Shop OBEX P1 Docs P2 Docs Learn Events
Color Sensor — Parallax Forums

Color Sensor

DigitalDjDigitalDj Posts: 207
edited 2007-11-08 03:51 in BASIC Stamp
I don't know if this is the best place to post this but i'll give it a try!

I have the Color Sensor and I want to make some changes to it. I am using it to calibrate some squares in a grid that have rgb leds For one I would like to add dimming for the white leds from within the code and add a control. The reason I want to do this is the light from the white leds want to wash out my light from my rgb squares. With the white leds off on the color sensor there is not enough light from the grid to activate the sensor for it to work properly, so I am looking for a happy medium.

Second I was wondering if there is a way to get a more defined color sensing? Maybe a decimal on each one of the rgb color bars on the computer program where it also reads up to the 255. This may be something for someone at Parallax to help on.

I attached a pic of the grid!

I actually think this will work good it just needs some tweaking with what I am doing.

Thanks,
Kevin



·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔



Post Edited (DigitalDj) : 11/8/2007 1:34:36 AM GMT
1272 x 2004 - 315K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-08 02:13
    If you're measuring a radiant source, such as your RGB LEDs, you will want the white LEDs on the TCS230-DB OFF, period. Otherwise, you'll just be illuminating the white diffusers on your light grid, which tells you nothing about the illumination source. Also, be sure to measure the output in an otherwise-darkened room to eliminate ambient reflection from the diffusers. If you're getting too low a reading, you can always increase the sample time. This can be accomplished in the BASIC Stamp program that accompanies the color matching PC host program.

    -Phil
  • DigitalDjDigitalDj Posts: 207
    edited 2007-11-08 02:44
    Phil,

    Where in the code can I change the sample time?

    Will try! Thanks!

    Kevin




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-11-08 03:51
    Kevin,

    At the very bottom of the program TCS230DB_Demo.bpe is a line that looks like this:

    DATA  15, 12, 9
    
    
    


    These are the acquisition periods for red, green, and blue, respectively. By changing these values to larger numbers, you can increase the sample times for each color component. Try increasing them in proportion to the values already there.

    You can run this program separately, without running the color match PC program, to read the raw color values in your DEBUG screen.

    -Phil
Sign In or Register to comment.