Page 1 of 1

Simple loop for colour check

Posted: 27 Dec 2012, 20:29
by eurof
I wonder if somebody can help me.

I have just started to use NXT and am trying to program my Alpha Rex to detect a yellow ball and then move on. If the colour is not yellow,I want the Rex to rotate so that he drops the ball and then prompt me again for another ball.

Any advice will be great.

Re: Simple loop for colour check

Posted: 08 Jan 2013, 13:58
by hassenplug
The Pseudo code would be something like this:
Start Loop
Check ball color
if ball is not yellow, drop ball
if ball is yellow, exit loop, otherwise, return to Start Loop
Do stuff with yellow ball


Does that help?

Steve