Enumerations
Understanding C++ Enums
What is an Enumeration?
Using Numbers Instead of Enums
int armPosition = 1;
int clawPosition = 2;
if (armPosition == 1 && clawPosition == 2) {
// Raise arm and open claw
armMotor.move(100);
clawMotor.move(100);
} else if (armPosition == 2 && clawPosition == 1) {
// Lower arm and close claw
armMotor.move(-100);
clawMotor.move(-100);
}Using Enums
Enums Inside Namespaces
Teams Contributed to this Article:
Last updated
Was this helpful?
