9
Programming a light Programming a light sensor to follow a sensor to follow a black line black line

Programming a light sensor to follow a black line

Embed Size (px)

Citation preview

Programming a light sensor Programming a light sensor to follow a black lineto follow a black line

Drag and drop a loop icon into the program.

Next, grab a Switch icon and drop it into the loop. You may need to

hover over the loop for a second or twountil it goes inside the loop.

Switch the sensor to light sensorAnd put it on port 1. Also make

sure that “generate light” is selected and set the value at 50 for now.

You may have to tweak that number later.

Drag one motor into the top part of the switch.

Make sure it’s:-in port C-it’s turned off

Drag a second motor into the top switch. Make sure that:-Port A is selected-The direction is set to reverse-Power is set to 50-Duration is set to Unlimited

Drag a third motor into the bottom part of the switch.

Make sure it’s:-in port A-it’s turned off

Drag a fourth motor into the bottom switch. Make sure that:-Port C is selected-The direction is set to reverse-Power is set to 50-Duration is set to Unlimited

The finished product should look like this!

Download the program to your NXT robot and go try it out on the test track.

Once you get it working, try modifying theProgram to make it perform better!