Lesson5.docx - LEGO Mindstorms Class Lesson 5 Line Following with the Light Sensor In the last class we used the Light Sensor to detect when our robot

Lesson5.docx - LEGO Mindstorms Class Lesson 5 Line...

This preview shows page 1 - 2 out of 5 pages.

LEGO Mindstorms Class: Lesson 5 Line Following with the Light Sensor : In the last class we used the Light Sensor to detect when our robot encountered a dark line. In this class, we're going to use the Light Sensor to help our robots follow along a dark line. Specifically, we will follow the edge of the line. Let's say we want our robot to follow a dark line on white paper. Remember, if we calibrated it, the light sensor will output a value from 0 to 100 depending on how much of the sensor is over the dark line. 0 means the sensor is totally over the line. 100 means the sensor is only over the white paper. Imagine what the sensor would see if it moved from left to right over a dark line (see picture below): Before we work with the line sensor, we'll need to calibrate it for the lighting conditions in the class today. Last week you loaded a program onto your robot called "Calibrate.rbt". Run it by holding the light sensor completely over the black line, and pressing the orange button on the brick, then holding the robot over the white paper and pressing the orange button again. You can test the calibration by viewing the output of the light sensor in a Light Sensor Block in the NXT-G window. Ask your instructors for help if you don't remember how to do this. Exercise 1: Write a line following program We're going to tell our robot to follow the lef edge of the line. In the picture above, we see that the sensor reading is high (> 50) if the sensor is mostly over the paper, and the sensor reading is low
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read all 5 pages?

  • Spring '19
  • rwewe
  • Right-wing politics, Left-wing politics

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes