Programing

Dynamic Maze

I added the ultra sonic sensor to the front of the robot so it could see where it was going. The robot is programmed to go straight until it is 10 cm away from a wall, then it will turn the desired direction to complete the maze.

Finished Code

FInished challenge

I added a color sensor to the robot so it could figure out where to stop, then I began to program. The program tells the robot to go forward unless it sees a wall, then it will turn right, then if it sees another wall, it will turn 180 degrees to the left to face the other direction. After that, it will turn forward again. It will repeat this process until it sees the black piece of paper at the end of the maze, then the program will tell the robot to stop the program to complete the maze.