While working with VEX IQ, you may want to run a project that was configured for a (1st generation) Brain on a robot with a (2nd generation) Brain. In this scenario, you will need to convert your project from '1st gen' to '2nd gen' in VEXcode IQ.
In most cases, there will not be any changes to the project during the conversion. However, there are a few instances where minor changes are made automatically when certain blocks are used in a 1st generation project. These changes will not affect how your project runs on an IQ (2nd generation) Brain.
Converting a Project with No Gyro - No Changes to Code
Open a (1st generation) project in the workspace. Then, select the Devices window icon.
Once the Devices window is open, select the '2nd gen' icon.
If no Gyro was configured, the '2nd gen' icon will highlight in blue to show that the project has been converted. You can now run this project on a (2nd gen) Brain.
Converting a Project with Gyro Configured - No Changes to Code
If you have a Drivetrain with a Gyro configured, you will need to either configure the Gyro with the IQ (2nd gen) Brain, or configure the Brain Inertial Sensor that is emedded in the IQ (2nd gen) Brain.
Open a (1st generation) project in the workspace. Then, select the Devices window icon.
Once the Devices window is open, select the '2nd gen' icon.
If you have a Drivetrain with a Gyro configured, you will need to manually configure the external Gyro, or configure the Brain Inertial Sensor.
In this scenario, a conversion dialog window will open. Select 'Continue' to proceed with the conversion.
Note: If you do not have a Gyro configured, you will not get this message and your project will be converted.
You will be prompted to select the Gyro configuration; either Externail Gyro or Brain Inertial. Select one.
- If External Gyro is selected, it will be configured for the same port as was previously configured.
- If Brain Inertial is selected, your project will use the Brain Inertial Sensor embedded in the Brain, and the port will be free to use with other devices.
A message will appear to alert you that the project has been converted. Select 'OK' to proceed.
The '2nd gen' icon will highlight in blue to show that the project has been converted. You can also see that the Brain Inertial Sensor has been configured.
You can now run this project on a (2nd gen) Brain.
Note: If this project is converted back to 1st gen, the external Gyro will not automatically be configured. It will need to be manually configured in the Devices window.
Note: The conversion process will also start when a IQ (2nd gen) Brain is connected while VEXcode is in 1st gen mode.
Converting a Project with Minor Changes to Code Made Automatically
Open a (1st generation) project in the workspace. Then, select the Devices window icon.
Once the Devices window is open, select the '2nd 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 were 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 1st to 2nd 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 '2nd gen' icon will be highlighted in blue to show that the project has been converted. You can now run this project on a (2nd generation) Brain.
Interpreting Dialog Messages when Converting Projects
If there was a conversion 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 (1st generation) project to run on a (2nd generation) Brain.
Note: The conversion process will also start when a IQ (2nd gen) Brain is connected while VEXcode is in 1st gen mode.
{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
Here the message tells you that the conversion is completed, and the dropdown menu of the <Brain button pressed> block has been updated.
Drivetrain Gyro Update
Here the message tells you that the Drivetrain Gyro Sensor was replaced with the Inertial sensor.