ROBOTC.net forumshttp://robotc.net/forums/ nMotorEncoderTarget Issueshttp://robotc.net/forums/viewtopic.php?f=66&t=6028 Page 1 of 1

 Author: StJamesSchool [ Tue Jun 25, 2013 9:57 am ] Post subject: nMotorEncoderTarget Issues Hello fellow programmers! In the nMotorEncoderTarget videos that are part of the RobotC curriculum, it says that the time (if "too much") should NOT effect the program that is running. It should stop at the target if the math is correct. Although we have confirmed that the mathematical part of the programming is correct, when we gave it extra time to make sure it ran the program fully, it still continued and passed the line. Why is the extra time effecting the outcome of the preset distance for the robot?Thanks again!

 Author: JohnWatson [ Tue Jun 25, 2013 10:14 am ] Post subject: Re: nMotorEncoderTarget Issues Hello,Would you be able to post the code using the [code] tags? There may be another piece of code that is making the robot continue moving further than it is supposed to, but we'll need to see the code to determine if this is the case or not.Thank you in advance!

Author:  StJamesSchool [ Tue Jun 25, 2013 10:38 am ]
Post subject:  Re: nMotorEncoderTarget Issues

Thank you for your response! Here is an example of one of our student's programming. He followed all of the mathematical steps correctly and we double checked for him, yet he still went over the line. Lessening the time to the exact time needed would completely go against the entire purpose of this lesson.

 Code:task main(){   wait1Msec(1000);   //allow time to move hand away from orange button//   nMotorEncoder[motorB]=0;         //clear encoder B//   nMotorEncoder[motorC]=0;         //clear encoder C//   nMotorEncoderTarget[motorB]=9356.4;    // distance in degrees to be calculated//   nMotorEncoderTarget[motorC]=9356.4;    // distance in degrees to be calculated//   motor[motorB]= 50;       //set motorB power//   motor[motorC]= 50;       //set motorC power//   wait1Msec(30000);        //set sufficient(or more) time to go distance//}