- :-

Topics Covered

  • Switches
  • Lesson Links

    Check Your Understanding:
    1. 1.The robot will move forward...
    2. ...if there is no object in front of the Ultrasonic Sensor when the program starts
      ...if there is an object in front of the Ultrasonic Sensor when the program starts
      ...if an object passes in front of the Ultrasonic Sensor at any time
      ...until an object passes in front of the Ultrasonic Sensor
    3. The robot makes its decision about whether to move forward or turn...
    4. Once, when the Switch is reached in the program
      Once, when the Switch sees an object
      Continually while the program is running
      The robot always moves, no matter what
    Mini Challenge

    Mini Challenge 2: Color Name Reader

    Some switches can have more than two branches.

    • Try creating a Switch with its Mode set to Color Sensor > Measure > Color.

    • Then, press the tiny + button (Add Case) on the Switch.

    Instead of a checkmark or X symbol, each branch now has a color. When run, the Switch checks the Color Sensor, and runs the branch with the matching color.

    If no match is found, the branch with the Default Case dot is run.

    For this mini-challenge, create a program that will say the name of the detected color out loud, by playing the Sound for that color word.