We're sorry, but you must have Javascript enabled in your browser to access this exercise.

Follow Walls/Maze

Define the speed of the robot's motors depending on what it sees so it follows the walls. Robot speeds are integers as before. Then press the Start Button.

Initially there is a walled arena but a maze can be chosen.

Keyboard controls

Press D for defining the speeds: use tab to move to next speed; S to start/stop the robot; W to toggle Reverse Left Motor; E to toggle between simple walls or maze.

Use I, J, K, M to move the robot Up,Left, Right or Down.

Exercise Tasks

First define the 6 speed pairs for moving the robot so that it goes along a wall. Hint if the robot just sees the wall it should steer towards it, but if close it should steer away. Then check the robot moves as you expect.

Then unclick "Walled Arena" and you will see a maze. Can you get the robot to explore it? Hint, your existing wall following should work, but think what you need to do to turn into a gap in the maze - the robot should also turn correctly when both sensors see the wall. Test it.

When No Wall is seen :

When Wall just seen on left :

When Wall closer on left :

When Wall just seen in right :

When Wall closer on right :

When Wall close to both sensors :

Reverse Left Motor

Left motor   Right motor

Left motor   Right motor

Left motor   Right motor

Left motor   Right motor

Left motor   Right motor

Left motor   Right motor

Walled Arena not Maze