Quote:
Originally Posted by stopyourself
As another rookie programmer, I can't explain the details to you very well but might be able to help you past some rookie mistakes. This picture would be moving the robot during auto using a flat sequence structure.
....
You can either use a flat sequence structure or while loops to do autonomous. Make sure you call the motor every 50ms or so -- if you tell it to do something once every 3 seconds or so, it will shut off after 0.5 seconds. Also, I've heard excessive while loops (bad stop conditions?) will bog up the processors and make it run slower. If you encounter this, fix that.
|
Stopyourself has made some good points.
Most important thing I can tell you is comment like crazy - you won't remember which frame is doing what once you get past about frame four.
Also, if at all possible, do not use time for the delay. There are some cases where there is no alternative (drive, unless you put encoders on for some reason), but the output will vary greatly with battery voltage, and even if it holds through qualifier matches, the quick turn around of eliminations will sink the battery, making the robot take longer to move the same distance.
I have tried to show some different simple things that can be used, a flat sequence, a time delay (some times its the only option

), and a limit switch, also some of the different places you can put comments.
Feel free to email me for help (click on my username and select send an email)