Line Following With One Light Sensor EducateNXT Attach a light sensor To attach a light sensor to the EduBot, refer to pages 32-33 of.

Download Report

Transcript Line Following With One Light Sensor EducateNXT Attach a light sensor To attach a light sensor to the EduBot, refer to pages 32-33 of.

Line Following
With One Light Sensor
EducateNXT
Attach a light sensor
To attach a light sensor to the EduBot, refer to
pages 32-33 of the NXT Building Guide (that
comes with the Education Kit).
EducateNXT
Reading the value of your light sensor
Click
Select
twice to
Then keep clicking
until
Now select the
port the light
sensor is in,
probably Port 3.
EducateNXT
Light readings for lots of things
Try getting light sensor readings for the following:
Midair ____________
Colored surface (Color ________ ) ____________
Colored surface (Color ________ ) ____________
Colored surface (Color ________ ) ____________
Darkest reading ____________
Brightest reading ____________
Black line on line follow board ____________
White area on line follow board ____________
Note: The light sensor does not read color. It reads how
much light is reflected – which is different for different colors.
EducateNXT
Edge following or line following?
The easiest
way to follow a
line is to follow
the edge,
moving on and
off the black.
EducateNXT
When on white it
When on black it
needs to go to black. needs to go to white.
?
?
EducateNXT
. . . And back to
black again.
While doing this, it
edges up the line.
EducateNXT
Basic Line Follow
Stops
Switch
B
Forward
Left
EducateNXT
Basic Line Follow
The Switch block
and its configuration panel
The trigger point value
determines when the sensor is
seeing black or white.
It is the average between the
black % and white %.
(Black% + White%) ÷ 2
EducateNXT
Basic Line Follow
A partially completed line-follow program should look like this . . .
IMPORTANT
Set Move block
duration to
“Unlimited.”
Don’t download
yet…
What still needs
to be added
EducateNXT
Add a Loop block. (The EduBot needs to line follow
forever.)
Then drag the Switch into the Loop.
1
2
3
Then Download.
EducateNXT
Have some fun
following the line . . .
EducateNXT
And for the teacher . . .
EducateNXT
Finished Line (Edge) Follow Program
EducateNXT
EducateNXT