
Re: Help with Variables and Functions...
There are quite a few things that can be improved with the code; rather than go through and point out each one piece by piece, here are a few very key things to focus on (which should help you resolve most of these issues).
You will need to make sure the code is commented and formatted properly. This includes the proper use of detailed comments, putting spaces in between commands, indenting nested control structures (while loops, if/else statements, etc). Specifically, you should take a look at the 'Fundamentals -> Introduction to Programming' section of the ROBOTC for VEX Cortex curriculum (linked below) as it walks through each of these key features step-by-step.
You should also take a look through the documents on Psuedocode, Whitespace, Comments, and ROBOTC Error Messages as they will help you organize and debug this code.
VEX Cortex Video Trainer using ROBOTC:
http://www.education.rec.ri.cmu.edu/pro ... index.html
_________________Check out our
Blog! And our
Facebook page!
Need help? Take a look at our
updated help documentation and the
ROBOTC Forums.