In this lesson, we’ll explore two important sensors: the Touch Sensor and the Ultrasonic Distance Sensor. These sensors help your robot interact with its environment, giving it the ability to “feel” and “see.”
What is the main difference between how a Touch Sensor and an Ultrasonic Sensor help a robot? The Touch Sensor is for sensing motion, and the Ultrasonic Sensor is for sensing color. The Touch Sensor is for telling when it feels something, and the Ultrasonic Sensor is for measuring how far something is. The Touch Sensor is for stopping a motor, and the Ultrasonic Sensor is for turning a motor. The Touch Sensor is for sensing sound, and the Ultrasonic Sensor is for sensing light. In the Ultrasonic Sensor activity, the robot stops when it gets to a certain distance from an object. How does the robot know what "close" means? The program uses a forever loop to check for close objects. The program uses an if-then block to check if the distance is less than a certain number. The program uses a sound to tell the robot how close the object is. The program uses a timer to measure how long the robot has been moving. What would happen if you forgot to put your if-then-else block inside a forever loop in the Ultrasonic Sensor program? The robot would check for obstacles only once at the beginning. The robot would go in circles instead of straight. The robot would be unable to move forward at all. The robot would stop at every obstacle, even if it was not close. A robot's program has an if-then statement: if the Touch Sensor is pressed, the robot moves backward. What would happen if the robot was programmed this way and drove into a wall? It would keep driving into the wall until you stopped the program. It would move backward and then stop. It would move backward and then keep moving backward. It would not react because the Touch Sensor needs an else command. What would be the best way to program a robot to move forward until it feels a light tap? Use a forever loop with a wait until block set to "when sensor is pressed lightly". Use a move forward block for a certain number of seconds. Use an Ultrasonic Sensor and a when distance is closer than block. Use a Color Sensor and a when color is block.