- :-

Topics Covered

  • Sensor Mode
  • Lesson Links

    Check Your Understanding:
    1. 1. When the Loop is set to Ultrasonic Sensor as shown below, what "condition" will cause it to pass Program Flow through (instead of sending it back)?
    2. The robot sees something within 30 centimeters immediately after moving forward
      The robot sees something within 30 centimeters immediately after backing up
      The robot sees something farther than 30 centimeters away
      The program repeats itself 30 times
    3. 2. If you want to make a Loop end based on a sensor reading, you should…
    4. Set the Loop's mode to "Sensor"
      Set the Loop's Mode to the sensor you want
      Select the sensor you want while the program is running
      Set the Loop's Mode to Count Sensors
    5. 3. When does a Sensor Loop check the sensor?
    6. Continuously while inside the Loop
      At the beginning and end of the Loop
      At the end of the Loop only
      At the end of every block within the Loop
    Try It!
    Try it! 1

    Other Sensors

    Set the Loop's mode to Touch Sensor instead of Ultrasonic Sensor. Make sure there is a Touch Sensor on the robot. Run the program and try to get the robot to stop!
    What happens?

    The robot will check the Touch Sensor instead of the Ultrasonic Sensor at the end of the Loop to see whether it will send Flow back or leave the Loop.

    If the Touch Sensor is being pressed in at the time the Loop ends, the robot will stop! If not it will start moving again.

    Mini Challenge

    Mini Challenge 1: Square Lap 3

    Make your robot run laps around the box until it encounters an obstacle in its way. The obstacle will be placed so that it is visible to the robot immediately after it turns.