Is there a way to put functions into a switch statement? i would like to use a switch statement for the lift i have as an example here, but im at a loss right now. i guess i mainly need to know how to set up a variable for this.
Here is what i have so far
#pragma config(Motor, port1, Lift1, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, Lift2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, Lift3, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, Lift4, tmotorVex393_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
void LiftPower(int power){
motor(Lift1) = power;
motor(Lift2) = power;
motor(Lift3) = power;
motor(Lift4) = power;
}
task main()
{
switch(){
case 1:
LiftPower(127);
break;
case 2:
LiftPower(-127);
break;
default:
LiftPower(0);
break;
}
}