Hello, people of the vex forum, I hope you guys are doing well,
I am trying to write a function that uses parameters for the movement of tiles to make autons easier to program since at that point it becomes just knowing the route you want.
The problem I am encountering is not knowing how to get the user input of the function
If I were to call this function I would need to add the direction I want to move and how many tiles I want to move which would then get multiplied by however many milliseconds it would take to move 1 whole tile.
Below is the code I am using
int main() {
void moveTiles(directionType, tile) {
int tile;
cin >> tile (This is supposed to be how you get input for c++ but I don’t know anymore)
int distance = tile * how long it takes to move one tile;
I’m not trying to get used input from the controller buttons but when you call a function you use parameters and I’m trying to use those parameters to calculate information
You could write some code that increases and decreases the value of a variable when you press the up and down buttons (showing the variable on the controller screen each time to keto track of it), then when you press a third button, calls the function you write with the current value of the variable.
Also, the API includes functions for spinning a motor a certain distance, please use those, It’ll be more accurate and consistent than converting to time.
Note that controller input during the autonomous period is prohibited (and blocked by vexos). So any parameters would have to be recorded and saved beforehand.
Right but the point is that all controller input (even button presses) is ignored during the autonomous period, so if your plan is to press buttons on the controller to change how your robot behaves in the middle of auton, that is both technically impossible and prohibited by rule.