My real question is how do I set up a void statement for a turn since left and right motors will be going at different speeds (either +/- for a point turn, or 0 for one motor and a + number for the other motor for a swing turn)

You would need separate parameters for each motor, i.e LeftMotorSpeed, RightMotorTarget, etc.If you're using RVW then you need a way to determine whether you should check if the current encoder count is greater than or less than the target. Otherwise nMotorEncoderTarget will work fine.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

My real question is how do I set up a void statement for a turn since left and right motors will be going at different speeds (either +/- for a point turn, or 0 for one motor and a + number for the other motor for a swing turn)

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.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum