Author |
Message |
BHHSrobotics
Rookie
Joined: Wed Jan 21, 2009 1:40 pm Posts: 14 Location: Brookings OR
|
 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
|
Tue May 18, 2010 5:05 pm |
|
 |
bluesaberist
Rookie
Joined: Sat Nov 22, 2008 8:06 pm Posts: 48
|
 Re: Color Sensor Programming
Why don't you post the code you are using, and we can help find the problem.
|
Tue May 18, 2010 9:30 pm |
|
 |
BHHSrobotics
Rookie
Joined: Wed Jan 21, 2009 1:40 pm Posts: 14 Location: Brookings OR
|
 Re: Color Sensor Programming
I would but we don't really even have a start.
|
Wed May 19, 2010 12:38 am |
|
 |
DIEvAl
Rookie
Joined: Sun May 16, 2010 3:31 pm Posts: 10
|
 Re: Color Sensor Programming
|
Wed May 19, 2010 12:46 am |
|
 |
BHHSrobotics
Rookie
Joined: Wed Jan 21, 2009 1:40 pm Posts: 14 Location: Brookings OR
|
 Re: Color Sensor Programming
For example I want the motors to go forward when the color sensor sees green.
|
Wed May 19, 2010 3:56 pm |
|
 |
Gary Samad
Expert
Joined: Mon Mar 15, 2010 4:24 pm Posts: 124
|
 Re: Color Sensor Programming
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
|
Wed May 19, 2010 6:19 pm |
|
 |
BHHSrobotics
Rookie
Joined: Wed Jan 21, 2009 1:40 pm Posts: 14 Location: Brookings OR
|
 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.
|
Wed May 19, 2010 9:16 pm |
|
 |
Gary Samad
Expert
Joined: Mon Mar 15, 2010 4:24 pm Posts: 124
|
 Re: Color Sensor Programming
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
|
Wed May 19, 2010 11:05 pm |
|
 |
BHHSrobotics
Rookie
Joined: Wed Jan 21, 2009 1:40 pm Posts: 14 Location: Brookings OR
|
 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!!! 
|
Thu May 20, 2010 4:36 pm |
|
 |
Gary Samad
Expert
Joined: Mon Mar 15, 2010 4:24 pm Posts: 124
|
 Re: Color Sensor Programming
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
|
Thu May 20, 2010 5:48 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 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
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Fri May 21, 2010 12:19 am |
|
 |
BHHSrobotics
Rookie
Joined: Wed Jan 21, 2009 1:40 pm Posts: 14 Location: Brookings OR
|
 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.
|
Thu May 27, 2010 4:45 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 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
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Fri May 28, 2010 1:18 am |
|
 |
Gary Samad
Expert
Joined: Mon Mar 15, 2010 4:24 pm Posts: 124
|
 Re: Color Sensor Programming
I second what Xander said.
Gary
|
Sat May 29, 2010 6:50 pm |
|
|