View unanswered posts | View active topics It is currently Tue Oct 21, 2014 10:46 am






Reply to topic  [ 14 posts ] 
Color Sensor Programming 
Author Message
Rookie

Joined: Wed Jan 21, 2009 1:40 pm
Posts: 14
Location: Brookings OR
Post 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
Profile
Rookie

Joined: Sat Nov 22, 2008 8:06 pm
Posts: 48
Post 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
Profile
Rookie

Joined: Wed Jan 21, 2009 1:40 pm
Posts: 14
Location: Brookings OR
Post Re: Color Sensor Programming
I would but we don't really even have a start.


Wed May 19, 2010 12:38 am
Profile
Rookie

Joined: Sun May 16, 2010 3:31 pm
Posts: 10
Post Re: Color Sensor Programming
BHHSrobotics wrote:
I just can't get the motors to run with it.

What do you mean?


Wed May 19, 2010 12:46 am
Profile
Rookie

Joined: Wed Jan 21, 2009 1:40 pm
Posts: 14
Location: Brookings OR
Post 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
Profile
Expert

Joined: Mon Mar 15, 2010 4:24 pm
Posts: 124
Post 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


Wed May 19, 2010 6:19 pm
Profile
Rookie

Joined: Wed Jan 21, 2009 1:40 pm
Posts: 14
Location: Brookings OR
Post 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
Profile
Expert

Joined: Mon Mar 15, 2010 4:24 pm
Posts: 124
Post 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


Wed May 19, 2010 11:05 pm
Profile
Rookie

Joined: Wed Jan 21, 2009 1:40 pm
Posts: 14
Location: Brookings OR
Post 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:


Thu May 20, 2010 4:36 pm
Profile
Expert

Joined: Mon Mar 15, 2010 4:24 pm
Posts: 124
Post 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


Thu May 20, 2010 5:48 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Rookie

Joined: Wed Jan 21, 2009 1:40 pm
Posts: 14
Location: Brookings OR
Post 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
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Expert

Joined: Mon Mar 15, 2010 4:24 pm
Posts: 124
Post Re: Color Sensor Programming
I second what Xander said.

Gary


Sat May 29, 2010 6:50 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.