Re: Using Void Statements?
A couple of things to note:
-These are called 'functions' and not 'void statements'; the reason for this distinction is that you can have many different types of functions (int, char, string, etc) and void is only one of the acceptable type. If you call them void statements, people may not know what you are talking about and it may cause some confusion.
-Be careful with the naming of your functions. Right now you have the function being called 'go straight' with a space in between, which will cause errors (because of the space in between the two words). The function is called correctly in task main, however.
-You may want to look through the videos that explain encoder usage again, just to be safe; the code you have in your gostraight function will turn the motors on, set the encoders to a value, and that's it. There isn't anything that actually controls how long the robot moves for, target distance, etc.
Check out our Blog
! And our Facebook page
Need help? Take a look at our updated help documentation
and the ROBOTC Forums.