Chitti app logo

Chitti is better in the app

Coins, streaks and builds — free on Android & iOS

Get the app
Chitti logoChitti

Conditions

7 Minutes · Module 5 - Dynamic wall Maze

Learn dynamic wall maze programming in VEXcode VR using conditions and distance sensors for students. A Tamil robotics lesson.

  • Checking distance with front eye sensors and if-else conditions
  • Adding a while loop with the down eye sensor to reach the red mark
  • Setting drive and turn velocity to 100 percent to increase speed
What this lesson teachesRead the lesson as text

A dynamic wall maze in VEXcode VR is a maze challenge where the layout of the walls changes every time the playground reloads. To navigate from the green start point to the red finish mark without hitting shifting walls, a robot must make decisions based on sensor readings using conditions and loops.

Navigating using if-else conditions

To check for an open path, the robot reads its front distance sensor in millimeters using a greater-than operator inside an if-else block. If the detected distance to an obstacle is greater than 260 mm, the robot drives forward for 250 mm into the clear space. It then turns right 90 degrees to explore whether a path continues in that direction. If a wall is present and the distance is 260 mm or less, the else condition runs, commanding the robot to turn left 90 degrees to find another route.

Stopping at the goal with a while loop

  • The maze starts on a green point and ends when the robot reaches a red target mark.
  • Running the if-else navigation code only once moves the robot a single time, so the code must be placed inside a loop.
  • A while loop is combined with a logical not operator and a down eye sensor block set to detect red.
  • The robot repeatedly executes its wall-checking and driving instructions as long as the down eye sensor does not detect red.
  • As soon as the down eye sensor reaches the red mark, the loop ends and the robot stops moving.

Improving movement and speed

  • Placing a turn right for 90 degrees block directly under the starting block prevents the robot from driving out of the playground at the beginning.
  • The default speed of the robot is slow during the maze run.
  • Adding a set drive velocity block and changing it from 50 percent to 100 percent increases the forward driving speed.
  • Adding a set turn velocity block at 100 percent speeds up every 90-degree turn the robot makes between wall checks.

Part of the course

ROBOTIC SIMULATION

View course →