I recently purchased 2 color sensors since the ambient light sensor has a red light and cant differentiate the blue line with the ground, but I purchased them seeing that the color also has an ambient light sensor. I know how to use the rgb values perfectly well, I just haven't seen any resources showing how to utilize the part of the sensor, and I need that function to tell the difference between the ground and the black platform. Any help is appreciated, thanks!

_________________Head Programmer FTC Team 6699, Tempest

Code:

<Life> Fun</Life>

Thu Oct 10, 2013 9:30 pm

Ernest3.14

Professor

Joined: Sat May 18, 2013 1:24 pmPosts: 271Location: Olympia, WA

Re: NXT Color Sensor 2.0

How close are you mounting the sensors to the ground? Are these LEGO sensors or HiTechnic sensors?

They are about an inch off the ground (pointed down of course) and they are lego sensors

_________________Head Programmer FTC Team 6699, Tempest

Code:

<Life> Fun</Life>

Fri Oct 11, 2013 8:22 am

cookthebook

Rookie

Joined: Wed Jan 09, 2013 11:48 pmPosts: 46Location: Saint Paul, MN

Re: NXT Color Sensor 2.0

This is from the Lego site itself: "The NXT Color Sensor is able to perform three unique functions. It acts as a color sensor, distinguishing among six colors; it works as a light sensor, detecting light intensities – both reflected light and ambient light; and it works as a color lamp, emitting red, green, or blue light."

So I don't know how RobotC handles those two other functions.

_________________Head Programmer FTC Team 6699, Tempest

Code:

<Life> Fun</Life>

Fri Oct 11, 2013 6:02 pm

Ernest3.14

Professor

Joined: Sat May 18, 2013 1:24 pmPosts: 271Location: Olympia, WA

Re: NXT Color Sensor 2.0

I see what you mean. You can detect ambient light intensity simply by adding up the RGB values and dividing by 3. As to the "color lamp" functionality, you'll have to find drivers for the sensor. I don't think Xander has written drivers for the NXT color sensor yet (there's one for the light sensor though).

I've never really done a lot with the LEGO colour sensors but hopefully the raw values will be able to help you. There's some RGB to HSV conversion code in my driver suite, I think it might be in the common-light.h file. From what I have gathered is that HSV is much easier to map to actual colour ranges than RGB.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum