My students are trying to complete a simple maze using a distance sensor and Vex V5 brain. The maze is basically to move forward, turn right, move forward, turn left sensing an object. We are new to coding and trying to use conditional and if statements, but we cannot get it to turn left or being to run a code for any type of maze and not just one path. Any suggestions on coding for this to work? TIA
Hi Laura.
Can you post an image of the code you have tried so far?
Does the robot have just a single distance sensor on it? If so, how are you making the decision as to if the robot should turn left or right when it encounters a wall?
Another idea is to use VEXcode VR. You can use the VR robot and the maze playground to test your logic. The VR robot also has a distance sensor - so again, you can test your logic in coding the distance sensor. The blocks in VR are the same blocks as in VEXcode V5.
This unit from the CS Level 1 Blocks Course walks you through the challenge and the Distance Sensor: Unit 5 - Detecting Walls from a Distance - Introduction | VEX Education
VEXcode VR allows you to test your code/logic in a “clean” environment. Meaning - the distance sensor won’t be affected by your classroom environment or the build of the robot. For example, my students would sometimes plug the distance sensor in the incorrect port and then tell me that they had a broken sensor
Thanks,