Skip to content

Instantly share code, notes, and snippets.

@jimmyli97
Last active August 29, 2015 14:11
Show Gist options
  • Save jimmyli97/ef4ed857040314b3c9eb to your computer and use it in GitHub Desktop.
Save jimmyli97/ef4ed857040314b3c9eb to your computer and use it in GitHub Desktop.
//An example of how RobotC stores motors
typedef enum tMotor {
leftMotor = 0,
rightMotor = 7,
centerMotor = 1,
} tMotor;
//RobotC variable that keeps track of # of maximum motors
int kNumbOfTotalMotors = 10;
//Array with maximum size of # of total motors
int maxMotorPowers[kNumbOfTotalMotors];
maxMotorPowers[(int) leftMotor] = 100; //(int) leftMotor = 0, a valid array index
maxMotorPowers[(int) rightMotor] = 50;
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment