Last active
August 29, 2015 14:11
-
-
Save jimmyli97/ef4ed857040314b3c9eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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