Entry Points to VEX

This article shows users the available VEX coding resources and content.

An Introduction to Coding

Writing code uses: syntax, structures, commands, parameters

Creating logic uses: sensor data, conditionals, loops, operators

Interfacing with the world uses: motors, mechanisms, manipulators, motion

Computational Thinking uses: algorithms, abstraction, critical thinking, problem solving, creativity

The love of code uses: failure, perseverance, and the overwhelming joy when your code finally works

All of these components are what make a robot a robot. Coding is the glue that brings all parts together and lets students express their ingenuity by creating an amazing solution. Coding with robotics can change students' lives by showing them what they are capable of achieving.

— Tim Friez — the VEX intern who never left. Now VP of Educational Technology at VEX


Interviews With Students About Coding

Watch and learn from interviews as teams and students describe how they approach coding.

How the Farmersville Robotics Team wrote their V5RC code

Team Paradigm, 315Y, Engineering and Sensors


Accessing VEXcode

Students collaborate at a VEX Robotics competition in Farmersville

VEXcode is the coding tool made by VEX for VEX robots. There are versions for VEX 123, GO, AIM, IQ, EXP, V5, and AIR. There is also VEXcode VR that lets you program Virtual Robots.


Use VEXcode Help

VEXcode with Help on the right side.

In every version of VEXcode, coders can view help documents on the right side of the screen. When a coder clicks a block or text command in the toolbox, the help viewer explains how it works and provides example code. This gives coders support right when they need it, helping them learn commands and debug their code.

Help exists for:

  • Blocks
  • Python
  • C++

Start With Virtual Skills

Virtual skills page of VEX on vrskills.vex.com

Virtual Skills (vrskills.vex.com) is a good place to get started with coding for VEX Competitions. It provides students with the opportunity to practice coding even when they don't have immediate access to the physical robot. It also eliminates the need to constantly reset the field or charge batteries. This provides immediate feedback that can be used to improve coding skills.

Benefits:

  • Gain coding know-how
  • Test game strategy 
  • Practice coding in Blocks or Python
  • Improve debugging skills
  • Boost coding confidence

Code written in Virtual Skills will not transfer over to the team's custom robot because it is undoubtedly different from the Hero Bot that is used in Virtual Skills. However, the coding knowledge, game knowledge, and debugging skills learned from coding in Virtual Skills will be invaluable when students start coding the physical robot.

Students can compare their skills to others by viewing the Virtual Skills Leaderboards.


Should I Use Blocks, Python, or C++?

Start With Blocks

when started, drive forward for 200 mm blocks

For beginners we recommend starting with Blocks. Block-based coding is useful for beginners because it reduces the amount of syntax they need to manage, letting them focus on core computer science concepts. Rather than worrying about details like punctuation, spelling, indentation, or command order, students can choose readable blocks from a toolbox and stack them in a clear sequence. This makes coding more approachable and helps beginners build understanding before moving into text-based programming.

Read more about why learning blocks first is recommended.

Switch Blocks

Switch block of drivetrain.drive_for(FORWARD, 200, MM)

VEX offers a solution to assist users as they move from blocks to text using Python. Switch incorporates familiar elements of block-based coding and integrates text-boxes where text commands can be typed. This helps spare students undue frustration as they can gradually incorporate more text-based commands into their projects before moving to code fully in Python.

Read more about how to use Switch blocks to transition students from Blocks to text-based coding.

Transition to Python

drivetrain.drive_for(FORWARD, 200, MM) in python

For students who are ready to move to text, we recommend Python, unless your team or coach is more proficient in C++.

Why is Python recommended over C++?

  • Readability: Python contains less jargon and syntax than C++.
  • Future jobs: Python is used more widely than C++.
  • Education: Python is more likely to be taught in school.
  • Performance: Python performance is comparable to C++.

The VEX Library

VEX library front page showing VEX 123, VEX GO, VEX AIM, VEX IQ, VEX EXP, VEX V5, VEX CTE, VEX AIR, VEX VR

The VEX Library contains articles to help students get started with VEXcode. Article topics include:

  • Getting started
  • Installing VEXcode
  • Opening and saving projects
  • Robot configuration
  • Tutorials on Blocks, Switch, Python, and C++

Links to the VEXcode section for each VEX platform are below:


VEXcode API Reference

VEXcode API Reference with 123, GO, AIM, IQ, EXP, V5, CTE, AIR and VR

The VEXcode API Reference equips you with everything needed to effectively use VEXcode, including:

  • Coding with Blocks
  • Coding with Python
  • Coding with C++
  • VEXcode VR playgrounds

Learn Coding With Virtual Robots

VEXcode VR with coral reef playground opened.

VEXcode VR (Virtual Robots) is a great way to learn coding while avoiding the need to charge batteries or reset your field every time you want to test your code.

  • Get started at vr.vex.com
  • Tutorials and examples are available

Coding Support

There are multiple sources of support to help novice students.

VEXcode IQ Section of the VEX Library

  • VEX Forum: Students and coaches can post questions in the Programming Support channel. This is a great place to get help from the wider VEX community, including other users who may have run into similar coding challenges.
  • PD+ Community: The PD+ Community, one of the many offerings available to teachers in VEX PD+, is designed for educators to share ideas, ask for support, and learn from other teachers and coaches using VEX. Teachers and coaches can post questions in the Community after they get certified by taking a VEX Intro Course or join as a PD+ All-Access member. 
  • Contact the VEXcode Team:  If you are running into a software issue you can't solve, or have an idea on how to make VEXcode better, use the feedback button on the top right of VEXcode to provide comments, questions, and diagnostic information directly to the VEXcode team. 

Use the CS Curriculum

VEXcode VR window with coding project and the VR Robot driving

Learn to code in Blocks and Python using the free VEX Computer Science Courses and Activities.

Lessons include:

  • Introduction and fundamentals
  • Moving your robot
  • Repeating behaviors
  • Navigating a maze
  • Detecting walls from a distance
  • Decisions with colors
  • Moving disks with loops
  • Developing algorithms

Go to cs.vex.com, and check out the Activities and Resources while you are there!


VEX Visual Studio Code Extension

VEXcode is the recommended coding environment for VEX users as they start their journey learning to code. Students considering a career in coding, and who have become proficient in textual coding, will benefit from learning the tools used by professional coders. Microsoft’s Visual Studio Code is the tool of choice for 70% of professional coders worldwide. VEX has created an extension for Microsoft’s Visual Studio Code (VS Code) for this purpose.

VS Code is a feature-rich and extensible integrated development environment that is used by professionals everywhere to create production-quality software. The VEX VS Code extension will allow users to use production-quality tools seamlessly with VEX hardware. The source code for this extension is public, which will allow other users to build on top of what we have done to create new tools that they may find useful.

An adult and child working together at a laptop

Extension Features

  • VS Code compatible (version 1.66+)
  • Windows and macOS compatible
  • AIM, IQ (2nd Gen), EXP, V5, CTE, and AIR compatible
  • C++ and Python supported
  • Updates VEX firmware
  • IntelliSense for the VEX API
  • Integrated help/documentation
  • Imports projects from VEXcode
  • Creates new projects from templates
  • Hardware troubleshooting tools built in

Advantages When Compared to VEXcode

  • Multi-file support for C++
  • Version control integration (e.g., Git)
  • Real-time code collaboration with the Visual Studio Live Share extension
  • Customizable interface
  • User extensible with other VS Code Extensions

Learn more at vscode.vex.com

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: