Another way would be to put the move block inside the loop and set it to unlimited.  The loop should be set to loop until a lightsensor setup to look for reflected light find the blackline.  Note that when you exit the loop, you are still going forward because the move block was set to unlimited. To cure this issue, put another move block after the loop and set it to stop for whatever port(s) the motor(s) are attached to. you've now stopped on the black line.  One other thing our team has done is to lower the power when moving toward the line, this way, it will not travel much past the line before stopping.
 
Lloyd

Nov 2, 2010 10:47:41 AM, [log in to unmask] wrote:
Kevin,

One way would be to put on a move block in the direction you want to go followed by a wait block for light sensor. The move block should be set for unlimited rotations and the wait block is set up to look for light < 10 (or some number that will eliminate dark blue, etc).

Make sure and calibrate your light sensor for the ambient light on your table.

-Frank

-----Original Message-----
From: First Lego League in Virginia and DC [mailto:[log in to unmask]] On Behalf Of Kevin Weaver
Sent: Tuesday, November 02, 2010 11:33 AM
To: [log in to unmask]
Subject: [VADCFLL-L] light sensor and loops

We had a new idea for one of our missions but are getting stuck on the coding. The kids want to use a loop and let the robot roll until the light sensor sees the black line. We can't figure out how to make it stop moving and go onto the next bit of code at that point. Any tips?

-- To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".

-- VADCFLL administrative announcements are sent via VADCFLL-ADMIN-L. Visit https://listserv.jmu.edu/archives/vadcfll-admin-l.html to subscribe.

To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".
VADCFLL administrative announcements are sent via VADCFLL-ADMIN-L. Visit https://listserv.jmu.edu/archives/vadcfll-admin-l.html to subscribe.