Can anyone explain jpearmans code (buttons one)

#21

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

0 Likes

#22

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.

0 Likes

#23

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

0 Likes

#24

@lacsap ok thank you

0 Likes

#25

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.

0 Likes

#26

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

0 Likes

#27

Yes,

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!).

0 Likes