Simple loop for colour check

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
eurof
Posts: 1
Joined: 27 Dec 2012, 20:27

Simple loop for colour check

Post 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.
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: Simple loop for colour check

Post 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
---> Link to lots of MINDSTORMS stuff under my picture --->
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests