Skip to main content

Lesson 3: Post-Project Summary

  • When this project is run, the VR Robot continues to drive forward even when colliding with the first green disk.

    A top-down view of the VR Disk Maze Playground after running our VEXcode blocks project. The VR robot failed the challenge by driving forwards and running into the first green disk straight ahead of it.
  • This project only instructs the VR Robot to check the conditions of each [If then] block once at the beginning of the project.

    A diagram of the flow of logic in our VEXcode VR blocks project. Arrows indicate that each if statement is only run once before the project ends, thus making our project much less responsive than we would like. Our project checks if the front eye detects green, and if so it turns right for 90 degrees. Next, if the front eye detects blue it turns left for 90 degrees. Next, if the front eye detects red it stops driving. Lastly, if the front eye detects none it drives forwards.
  • The [If then] block is different from the [Wait until] block.
    • [Wait until] blocks do not require a decision to be made by the VR Robot. When the condition is TRUE, the [Wait until] block runs the next block in the stack. When the condition is FALSE, the [Wait until] block continues to wait until the condition is TRUE and stops the rest of the project from running.

      A diagram of the flow of an example VEXcode VR project that uses a Wait Until block in between a Drive Forward block and a Turn Right for 90 degrees block. The Wait Until block's parameter reads 'Front Eye detects green?'. Arrows indicate the flow of logic, showing that the Wait Until block holds the program driving forwards until its parameter is true, and it then stops driving forwards and turns right for 90 degrees.
    • [If then] blocks require the VR Robot to make a decision. If the condition is TRUE, then the blocks inside the [If then] C block are run. If the condition is FALSE, then the blocks inside the [If then] C block are skipped.

      A diagram of the flow of logic in our VEXcode VR blocks project. Arrows indicate that each if statement is checked only once, giving its internal blocks the option to run before the program's flow continues to the next if statement. After the last if statement is checked the flow of logic never loops back to check any of the if statements again, making the project much less responsive than we would like. Our project checks if the front eye detects green, and if so it turns right for 90 degrees. Next, if the front eye detects blue it turns left for 90 degrees. Next, if the front eye detects red it stops driving. Lastly, if the front eye detects none it drives forwards.
  • The VR Robot will continue to drive forward since the last [If then] block in the stack was reported as TRUE and all other blocks were reported as FALSE at the beginning of the project.
  • Save the project before moving on to the next Lesson.

Questions

Please select a link below to access the lesson quiz.

Google Doc / .docx / .pdf