Get color example

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

Get color example

Postby orangelightwhy » Wed Dec 19, 2012 4:30 pm

I am trying to make when the color sensor see red i motor moves. I have tried something but i cant get anything to work.
Last edited by orangelightwhy on Thu Dec 20, 2012 4:22 pm, edited 1 time in total.
orangelightwhy
New User
 
Posts: 7
Joined: Tue Dec 18, 2012 2:51 am

Re: Get color exsample

Postby skoehler » Wed Dec 19, 2012 7:42 pm

Show as code that you think should work, and we'll explain why it doesn't work and propose a solution.
Oh by the way: I don't exactly understand your question. Please fix the wording.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Get color exsample

Postby orangelightwhy » Wed Dec 19, 2012 8:44 pm

When the robot is seeing red it starts going one way when it starts seeing blue it starts going the other way.
I tried these ones
Code: Select all
 (ColorSensor.Color == RED)

Code: Select all
if (cs.getColorID() == 0)
orangelightwhy
New User
 
Posts: 7
Joined: Tue Dec 18, 2012 2:51 am

Re: Get color example

Postby orangelightwhy » Thu Dec 20, 2012 4:24 pm

i am using the lego color sensor i got from the box i am still trying to make it work but i am still getting erros
orangelightwhy
New User
 
Posts: 7
Joined: Tue Dec 18, 2012 2:51 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff