ROBOTC.net forums
http://www.robotc.net/forums/

Color Sensor Programming
http://www.robotc.net/forums/viewtopic.php?f=41&t=2389
Page 1 of 1

Author:  BHHSrobotics [ Tue May 18, 2010 5:05 pm ]
Post subject:  Color Sensor Programming

Our class is currently working on a mower bot. We have decided to use the color sensor so the robot can tell if it is over grass or sidewalk. I have had much trouble writing a code so the motors will run with the sensor values. I have tried the samples programs and the sensor works and can tell the difference between the two colors. I just can't get the motors to run with it. If anyone knows a code that will help please let me know.
Thank you

Author:  bluesaberist [ Tue May 18, 2010 9:30 pm ]
Post subject:  Re: Color Sensor Programming

Why don't you post the code you are using, and we can help find the problem.

Author:  BHHSrobotics [ Wed May 19, 2010 12:38 am ]
Post subject:  Re: Color Sensor Programming

I would but we don't really even have a start.

Author:  DIEvAl [ Wed May 19, 2010 12:46 am ]
Post subject:  Re: Color Sensor Programming

BHHSrobotics wrote:
I just can't get the motors to run with it.

What do you mean?

Author:  BHHSrobotics [ Wed May 19, 2010 3:56 pm ]
Post subject:  Re: Color Sensor Programming

For example I want the motors to go forward when the color sensor sees green.

Author:  Gary Samad [ Wed May 19, 2010 6:19 pm ]
Post subject:  Re: Color Sensor Programming

BHHSrobotics wrote:
For example I want the motors to go forward when the color sensor sees green.


You may want to start simply. Just write some code to make the motors run forward (there are examples that come with RobotC). After that works, make the robot turn left or right. After you understand how the motors work, write a second program that reads the color sensor and displays it on the display (oops, I don't think RobotC supports the color sensor yet?). Then integrate the two concepts.

cu,
Gary

Author:  BHHSrobotics [ Wed May 19, 2010 9:16 pm ]
Post subject:  Re: Color Sensor Programming

Thanks Gary but I have been programming my nxt for 2 years and I very well know how the motors run and how the color sensor works and get a value display of the color on the screen. I just need help on integrating the two.

Author:  Gary Samad [ Wed May 19, 2010 11:05 pm ]
Post subject:  Re: Color Sensor Programming

BHHSrobotics wrote:
Thanks Gary but I have been programming my nxt for 2 years and I very well know how the motors run and how the color sensor works and get a value display of the color on the screen. I just need help on integrating the two.


Ah, ok, maybe you can show us your code? How are you reading the color sensor? What is the color value that you see?

Gary

Author:  BHHSrobotics [ Thu May 20, 2010 4:36 pm ]
Post subject:  Re: Color Sensor Programming

OK, listen here Gare- Bear, I don't have a code thats why im asking for help. If you do know please help but if not don't reply!!! :breakcomputer:

Author:  Gary Samad [ Thu May 20, 2010 5:48 pm ]
Post subject:  Re: Color Sensor Programming

BHHSrobotics wrote:
OK, listen here Gare- Bear, I don't have a code thats why im asking for help.


As Xander (mightor) would say "We don't do your homework for you."

If you can show us your code, and describe what you're trying to do and what is happening instead, we will make suggestions and try to help you fix it.

cu,
Gary

Author:  mightor [ Fri May 21, 2010 12:19 am ]
Post subject:  Re: Color Sensor Programming

BHH,

I suggest you apologise to Gary for your remark or you may find yourself at the wrong end of a banhammer.

On these forums we don't do people's home work. Show us what you've done so far. Surely, with two years' worth of NXT programming experience, you should at least have some sensor reading code and some motor controlling code? When you have that, come back to us and we'll see about getting those two bits of code working together.

Nothing is for nothing.

Regards,
Xander

Author:  BHHSrobotics [ Thu May 27, 2010 4:45 pm ]
Post subject:  Re: Color Sensor Programming

Please let me apologize for the students who posted the rather rude comments to the people who tried to help them with the color sensor programming. We appreciate all of your assistance and I will moderate their other queries in the future. Thank you for your patience and understanding.

Author:  mightor [ Fri May 28, 2010 1:18 am ]
Post subject:  Re: Color Sensor Programming

Apology accepted.

Our offer still stands: show us some code and we'll help you with the next step.

Regards,
Xander

Author:  Gary Samad [ Sat May 29, 2010 6:50 pm ]
Post subject:  Re: Color Sensor Programming

I second what Xander said.

Gary

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/