When reading the forum over the past several days, I’ve noticed some confusion over the release of VEXcode 1.0 (and 1.0.1) and what has changed from the August 0.9 version. I want to try and clarify a few things and comment on a few rumors that seem to have started. I’ll also try and add some tips for the advanced user over the next few days,
Features were removed that were available in 0.9
mostly not true, all functionality that was available in the 0.9 version is available in 1.0. The exception is the competition checkbox that used to be present when creating a new project, the preferred way to do this now is to open the competition project example.
When you build a project in VEXcode, your source code is compiled and then linked against a special library that contains all of the VEX classes and functions that do things like making motors spin, we generally refer to this as the SDK, or software development kit, that VEXcode uses. Nothing was removed from the SDK for 1.0, all code (again, one minor exception, the drivetrain class changed ever so slightly) that was written in 0.9 will build in 1.0.
Should I update my 0.9 project.
My opinion, if you were happy with 0.9 and had created a project that was non-trivial, then don’t upgrade. The new graphical robot config will be disabled, but you have probably mastered creating instances of motors already.
I upgraded and VEXcode commented out all of my code.
If you upgraded, VEXcode will have commented out all of your code in main.cpp, the primary reason for doing this was to allow the graphical robot config panel to be used, instances of Brain and Controller in main.cpp would conflict with new instances created in robot-config.cpp and the project would not have built. The easiest way to revert this if you just upgraded is to use “undo” (CTRL-Z) and that commenting will be reverted, however, that step only works if you have just upgraded and not saved anything. If you do uncomment, remove the instance of vex::brain near the top of main.cpp as this will have been added to robot-config.cpp. If you take this approach then it’s probably best to avoid using graphical config, it is hard to have both ways of creating devices play nice together, so you need to choose, either stick to graphical or the way we were doing it in 0.9 and all the VEXcode previews unless you understand the implications of mixing both techniques.
Upgrading changes the SDK
The SDK used will be the same whether you upgraded your project or not. The upgrade process added the two robot-config files and enables graphical robot config, it does not have any impact on the code itself beyond commenting out the code in main.cpp as discussed above.
What are all these expert mode.
The expert modes only affect two areas. How the intellisense autocomplete works, and in 1.0.1, is graphical robot config available.
In both modes all functionality of the SDK is available.
VEXcode uses something called a language server to analyze errors in your code as you type, it’s this language server that creating the red squiggly lines in the code when you have an error. The language server is also used to suggest function and class names as you type, however, the language server will suggest things based on its understanding of all the source files, the vex SDK and also other standard header files that are needed to build a program. Although this is the standard approach used by professional programming tools, it can be confusing for beginners. To help with this, Robomatter created a simpler autocomplete tool similar to that which had been used in VCS. The “enable expert autocomplete” checkbox is used to select between these two methods, however, it has no impact on the complexity of the code you choose to write, your project can use all of the VEX SDK functionality in both cases.
The new mode added in 1.0.1 was to allow disabling of graphical config and allow editing of the default configuration files robot-config.cpp and robot-config.h. The reason that these files are read only when graphical is used is that any code added by the programmer would be lost when the graphical robot configuration is changed. To allow editing, graphical config must be disabled. If you add anything to robot-config.cpp and then go back and use graphical, those changes will be lost.
What is vexcodeInit
some of the things you can create in graphical robot config need some initialization code to be run. This includes , for example, the Controller if you have assigned buttons to run motors and the drivetrain if a gyro is being used. vexcodeInit is not a replacement for the old robotc pre-auton function, if you need code to be run at the beginning of your program place it in your own initialization function or in main after the vexcodeInit funtion.
VEXcode does not allow multiple source files
completely untrue, you can have many source files. You can also have multiple projects open at the same time
I have to use graphical config to configure a vision sensor
Not true, you can still create vision header files and configure in the same way as 0.9