Autonomous code tutorial

Sorry about the lateness of this, I just haven’t had time to sit down and write this up. But I figure some teams still might be able to use it. At http://www.combbat.com/programming/autonomous.shtml I have the tutorial. I came up with this code and then I saw in the white pages that some other people had a pretty similar idea for it too, so I wrote this up to help explain to rookie teams. Also, if any teams need help with their coding at the UCF Regionals or Nationals just come on by Team 21’s pit and ask for me (Mike) and I’ll come on over and help out. Good luck to everyone! If you need any help with your code you can also e-mail me at [email protected] and I’ll try to see what I can do to help out. Can’t wait to see what you guys do on the field! Good luck programmers.

There is one big problem with your code.

if counter = 50 ...

counter isn’t guaranteed to ever be 50. Consider this scenario, counter is 49, and delta_t is 1. you increment counter as counter + 1 + delta_t. So after that loop, counter is 51. Since counter never equaled 50, you stay in that state forever (well, until counter overflows, and you have a chance to do it all over again).

You should be using >=

In my assembly class, we had a problem similar to this, except my professor rigged it so that if you just used = it was going to fail almost every time (to make it easier to find out). Since then, that’s been one thing that I’ve always been careful about.

Thanks for that, I’ll fix that now. That might explain why every now and then we have that glitch. Thanks.