Looking for the default Cortex code

There is a long appendix to the VEX documentation that talks about the default code for the cortex. It’s set up to drive a 6 wheel base in either tank or arcade modes. It also has the ability to understand limit switches that are plugged into the analog ports.

Where can I find this code? The default code that now comes is for the clawbot, 4 wheel drive, arm and claw.

Thanks!

Pretty sure you get the default code [onto the robot] by flashing the Cortex using the firmware updater.

Not sure about the code itself if that’s what you’re asking for.

I think Foster is saying there is another version of the Cortex code that provides six wheel drive capability.

We ship a simulation of the default code with RobotC, this may have been an older version of the VEX default, however, it is setup for a six motor drive. You can find it in sample_programs->vex2->advanced->ROBOTC VEX Cortex default.c

This is how the motors are setup.

#pragma config(Motor,  port1,           LeftDrive1,    tmotorNormal, openLoop)
#pragma config(Motor,  port2,           LeftDrive2,    tmotorNormal, openLoop)
#pragma config(Motor,  port3,           LeftDrive3,    tmotorNormal, openLoop)
#pragma config(Motor,  port4,           RightDrive4,   tmotorNormal, openLoop)
#pragma config(Motor,  port5,           RightDrive5,   tmotorNormal, openLoop)
#pragma config(Motor,  port6,           Mech1,         tmotorNormal, openLoop)
#pragma config(Motor,  port7,           Mech2,         tmotorNormal, openLoop)
#pragma config(Motor,  port8,           Mech3,         tmotorNormal, openLoop)
#pragma config(Motor,  port9,           Mech4,         tmotorNormal, openLoop)
#pragma config(Motor,  port10,          RightDrive10,  tmotorNormal, openLoop)

and drive control jumpers.

jmp11 = 0 && jmp12 = 0: Single Driver TANK
jmp11 = 1 && jmp12 = 0: Dual Driver   TANK
jmp11 = 0 && jmp12 = 1: Single Driver ARCADE
jmp11 = 1 && jmp12 = 1: Dual Driver   ARCADE

I also wrote a version for ConVEX, you can see that here.

James to the rescue again, that is exactly the code I was looking for! Since everyone has RobotC it will be easy to use that.

We are in early season mechanical design at my middle school, I wanted something simple that they can all use to get started, we can make code across Christmas.

It’s pretty old code, from before my time, I will have a look at it later and see if it needs any TLC.

Don’t go crazy, you know how that primordial code looks … :slight_smile: