BOOL right(int color, float angle) {
	if (color) {
		return motionDriverRight(angle);
	}
	else {
		return motionDriverLeft(angle);
	}
}
Example #2
0
void doInstruction() {
    int currentTime = getCurrentTimeInSecond();

    if (instructionIndex == 0 && currentTime > 1) {
        motionDriverForward(600.0f);
        instructionIndex++;
    }
    else if (instructionIndex == 1 && currentTime > 10) {
        motionDriverLeft(1800.0f);
    }
    else if (instructionIndex == 2 && currentTime > 20) {
        motionDriverForward(600.0f);
    }
}