While working with VEX IQ, you may want to run a project that was configured for a (2nd generation) Brain on a robot with a (1st generation) Brain. To do this, you will need to convert your project from '2nd gen' to '1st gen' in VEXcode IQ.
In some scenarios, minor changes are automatically made to the code or configuration during a conversion, and these changes will not affect how your project runs on an IQ (1st gen) Brain. However, there are some circumstances where changes are made to a project during conversion that require the project to be updated in order to run on a robot with a (1st gen) Brain.
Converting a Project with External Gyro - No Changes to Code
Open a (2nd generation) project in the workspace. Then, select the Devices window icon.
Once the Devices window is open, select the '1st gen' icon.
The '1st gen' icon will highlight in blue to show that the project has been converted. You can now run this project on a (1st gen) Brain.
Note: In this example the external Gyro is configured for port 4 and no updates need to be made. If you were to convert back to a 2nd gen project, there is a step where you would need to confirm this configuration. See this article for more information.
Converting a Project with Brain Inertial Configured - No Changes to Code
If the Brain Inertial is configured in the IQ (2nd gen) project, you will need to update to either configure for an external Gyro sensor, or no Gyro.
Open a (2nd generation) project in the workspace. Then, select the Devices window icon.
Once the Devices window is open, select the '1st gen' icon.
A message will appear to alert you that the project will need to be converted. Select 'Continue' to proceed with the conversion.
A conversion completion message will open alerting you that the Brain Inertial sensor configuration has been removed. It will also list any changes that were made. See below for more information on hot to interpret dialog box messages.
Select 'OK" to proceed.
The '1st gen' icon will highlight in blue to show that the project has been converted. You can now run this project on a (1st gen) Brain.
You will either need to configure an external Gyro, or proceed with no Gyro configured.
Converting a Project with Changes to Code
Open a (2nd generation) project in the workspace. Then, select the Devices window icon.
Once the Devices window is open, select the '1st gen' icon.
A message will appear to alert you that the project will need to be converted. Select 'Continue' to proceed with the conversion.
Note: This message will only open if changes will be made to the project code.
A conversion completion message will open and list any changes that were made. In this example, the {When Brain button} event block dropdown menu was updated from 2nd to 1st generation configuration.
- See the section below for more information on the different messages that you may receive, and how to interpret them.
Select 'OK' to save the project conversion.
The '1st gen' icon will be highlighted in blue to show that the project has been converted. You can now run this project on a (1st generation) Brain.
Interpreting Dialog Messages when Converting Projects
If there was a change to the code needed due to any of the conditions shown below, the message after conversion will be: "Project conversion has been completed with these changes," followed by a list of any changes that were made to the code. Below are the changes that you may encounter when converting a (2nd generation) project to run on a (1st generation) Brain.
Dialog Messages for Changes Made Automatically
{When Brain button} Dropdown Menu Updated
{When Brain button} Dropdown Menu Updated
Here the message tells you that the conversion is completed, and the dropdown menu of the {When Brain button} block has been updated.
Dropdown Menu Updated
This message tells you that the dropdown menu of the <Brain button pressed> block has been updated during the conversion.
Project Slot Changed
Here the message tells you that the Project Slot has been changed during the conversion.
Dialog Messages for Changes that Require Code to Be Updated
Drivetrain Inertial Sensor Removed
This dialog message tells that the Drivetrain Inertial Sensor configuration has been removed during the conversion.
If a project is configured with the Inertial Sensor that is built into the (2nd generation) Brain, the Inertial Sensor will be removed from the Drivetrain configuration in order to be compatible with the (1st generation) Brain.
- You may need to configure a Gyro Sensor for your project to run as desired on the (1st generation) Brain.
Some {When started} blocks have been disabled
This message tells you that some {When started} blocks have been disabled during the conversion.
A (1st generation) Brain can only support up to 3 {When started} blocks, while the (2nd generation) Brain supports up to 8. If there are more than 3 {When started} blocks in the (2nd generation) project, the additional {When started} block(s) will be disabled during the conversion process. You will not be able to enable the extra when started while in gen 1 mode.
Note: The software will prioritize {When started} blocks from the top left corner of the Workspace.
Note: If the project is converted back to 2nd generation, these blocks will not automatically be enabled. You will have to enable them manually in the Workspace.
IQ (2nd generation) Specific Blocks Disabled
This message lets you know that any blocks specific to IQ (2nd generation) have been disabled.
If blocks are disabled, they will not run in a project. It may be necessary to update the project so that it runs as desired.
Additionally, if block parameters are set for IQ (2nd generation)-specific configurations as shown on the left, the block will be disabled in the conversion. This block can be enabled after the conversion by changing the 'BrainInertial' parameter in the drop down window.
Note: If the project is then converted back to 2nd generation, these blocks will not automatically be enabled. You will have to enable them manually in the Workspace. You will not be able to re-enable blocks that are specific to the IQ (2nd gen) Brain.
The blocks shown on the left are examples of IQ (2nd generation)-specific blocks: Draw and Inertial Sensing blocks. These blocks will be disabled if they are in a project that is being converted to 1st generation.
- Note: There are some blocks that are shared between the Gyro and Brain Inertial Sensor. If you use those blocks and have the gyro selected, they will not be disabled. Only blocks that have the 'BrainInertial' selected will be disabled.
Because the Console View is not supported for IQ (1st generation), any blocks that have the 'Console' option selected in the menu will be disabled when converting to a 1st gen project.
These blocks can be enabled if the menu option is changed. In the examle on the left, the [Print] block is disabled because 'Console' is selected.
The block can be enabled by selecting the 'Brain' option, since this option is supported.
A single project may have multiple changes. VEXcode will make all of the conversions at once and list all changes in a single message — as shown on the left.