I attached a zip file with my code from our last year's robot. Included is some programming guidelines you should follow when programming your robot (put together by one of our EEs). They are good programming ethics, your time will be much easier in the long run if you study them and follow them. Take a look at the program and you'll see what I mean.
You'll need the PBASIC documentation from Parallax:
http://www.parallaxinc.com/downloads...ual%20v2.0.pdf
It contains everything you'll need for understanding the code.
You'll also need the PBASIC editor from Parallax:
http://www.parallaxinc.com/downloads...p%20Editor.exe