|
Re: Autonomous Program HELP!
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
|