Autonomous Program HELP!

Hello, i made an autonomous program, and i would like to see if it will work, could anybody give me feedback?





In your while loops, you do not need to increment the counter ‘i’. Each time through the loop it will increment itself. Other than that it should work. For a little more accurate timing, you could use a timer and a shift register. If you are not familiar with those, probably don’t want to go down that path at this time.

Looks to me like it would work just fine.

I think the i + 1 is OK in the loop… it makes sure the loop executes exactly the number of times you want. In the left-most loop, that would be 200 times. If you took out the +1, it would execute 199 times. You could clean it up a bit by changing the while loop to a for loop, then wire 200 to the N terminal of the for loop (it would do the exact same thing, just easier to read).

I agree that you would get more accurate timing using timer functions. In your case, you are assuming that each iteration of the loop will take exactly 50ms. However, each iteration will take a bit longer: 50ms running the “wait” block, some time running the DriveMotors block, plus whatever it takes to loop back around. Over a few hundred iterations, that error will add up, but I don’t think it will matter too much in our case: 10s may end up being 10.1s.

David

You probably already caught this, but you need a reference name for your Arcade Drive.

Thanks, i will deploy and try at competition