So we are putting an adjustable launcher on our robot, and I want to put in a code where I use the X and Y buttons on the controller to select how many squares from the flag we are, and then use A and B to select which of the high flags we want to hit. I have no idea how to do this or where to start. Any help would be appreciated, the sooner the better.
IMO, rather than making flywheel-speed / puncher-angle and robot turn a function of the x, y and height distances, it would be better to create an array of these values for each viable tile.
For my team, we created an array like stated above and created 5 buttons that represented the row and two triggers for high and low flags. To program it, I created a while pressing for the triggers and put an if pressing for the tiles in the while loop so that when you press both buttons, it moves the shooter to a position in the array
Do either of you have a basic code that I could build off of to adjust it to our bot?
I don’t have it on me right now, but I could post an example once I have access to my code in about 6 hrs. The basic idea is
while(Controller.BittonR1.pressing())//selecting flag
{
If(Controller.ButtonX.pressing())//selecting row
{
MoveShooterTo(somePosition);
}
//repeat for each row
}
//repeat for other flag row
Great thanks