I was wondering if anyone has any sort of sample code for color sensors from hitechnic in RobotC

any help will be greatly appreciated

Wed Jun 27, 2007 3:37 pm

steve

Rookie

Joined: Sat Jun 09, 2007 8:41 amPosts: 7

color sensor

Hello JT

I just started a program that uses the color sensor. I'm built the LEGO TriBot, and the TriBot arm is suposed to come down and pick up a blue ball that is on a stand.

In the RobotC Motors and Sensors Setup I have:

name: colorSensor
type: SONAR 9V

In my program I have:

if (SensorValue(colorSensor) == 2) break;

As the TriBot arm comes down, the sensor value is 0. When the color sensor gets close to the blue ball, the color sensor value changes to 2.

Steve

Thu Jun 28, 2007 9:21 am

dtrotzjr

Rookie

Joined: Sat Jun 16, 2007 6:24 pmPosts: 14

If you are interested, I own a couple of these sensors, I could add the sensor to my sensor driver posted in another thread in these forums.

Sat Jun 30, 2007 1:43 pm

JT2007

Rookie

Joined: Wed Jun 27, 2007 3:33 pmPosts: 2Location: canada

dtrotzjr wrote:

If you are interested, I own a couple of these sensors, I could add the sensor to my sensor driver posted in another thread in these forums.

thanks...your help is much appreciated

Wed Jul 04, 2007 9:17 pm

dtrotzjr

Rookie

Joined: Sat Jun 16, 2007 6:24 pmPosts: 14

Sorry JT2007 I have been using nXc lately and haven't spent much time with RobotC. I will try to get to this for you by the end of the week. It should be pretty easy to do since I have a basic skeleton in place.

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