So i’m working in vexcode V5 text and want to create a function that creates a min/max encoder value for a motor. However, i can’t see a way how to substitute the motor in the function arguments. here is the code
void minmax(motor, int max, int min){
if(motor.rotation >= min){
}
}
I don’t have anything beyond this because i don’t know how i’d be able to make the motor you want to minmax be within the arguments
i see what you’re trying to say here, but what i meant was if it was possible to substitute a button in the function with a button that you put into the argument, so like
void bblehbleh (int speedorsomething, BUTTON, int goovy){
if(Controller1.BUTTON.pressing()){
}
something like that
the problem with that is that in my function i would need to call for every single button and only 1 would be used, it would just be a giant block of text and would be easier to just not use the function at all, though this might be possible but right now this isn’t exactly what i’m looking for
i want to make coding as convenient and organized as possible, currently i have a whole bunch of if’s else if’s and else’s just to make motor groups move with some button push, creating this function will help make coding easy and oraganized