Can anyone explain jpearmans code (buttons one)

Yes, this auton would run when the first button is pressed. Also remember that this only runs with a competition switch.

I am going to clean up my team’s code (they loathe commenting sometimes) and make an example program for our approach. Teams will have to adapt the code to their implementation. It is not a way most would think about autonomous selections. I should have it up by tomorrow evening.

@mvas8037 so if it ==2 for say, would it run box number 2?

@lacsap ok thank you

No, you would run #3 - the values run from 0, 1, 2, 3 for the buttons that appear in 1st, 2nd, 3rd, and 4th position on the screen. It is confusing, but makes sense for those who have done a lot of computer programming.

@lacsap so 0 represents box 1, 1 represents box two, and so on?


I just posted a different approach under “WalshBots Autonomous …”

It is a complete solution but takes a different approach - you run your autonomous path and have conditions that you may alter - for example, if you are Blue alliance you need to make left turns instead or right, and you have to account that the alliance platform is one inch closer to the alliance station (I think!).