Book
Day 2 - Section 2 - Using Variables and Detecting Obstacles
Day 2 - Section 2 - Using Variables and Detecting Obstacles
Completion requirements
View
After the completion of this section the students will be able to:
- create and use variables in Edison software
- use the infrared sensors to detect obtacles
- make the robot stop if it detects an obstacle
Chapter 5.3 - Detect obstacle and stop
Write the following program to have the Edison robot drive until it encounters an obstacle.
The red (control group) detect obstacle icon is required to turn the obstacle detection system on and starts the IR light emitters.
The dual drive speed is set to 5 to allow the robot to detect an obstacle before colliding with it. If the speed is too fast then the robot will crash into obstacles.