ROBOTC.net forums
http://www.robotc.net/forums/

does this mean go forward for only 100 degrees rotation?
http://www.robotc.net/forums/viewtopic.php?f=1&t=8030
Page 1 of 1

Author:  alisbahc [ Sun Feb 23, 2014 5:11 pm ]
Post subject:  does this mean go forward for only 100 degrees rotation?

does this mean go forward for only 100 degrees rotation?

task main()
{
nMotorEncoder[motorB] = 0;
nMotorEncoder[motorC] = 0;

nMotorEncoderTarget[motorB] = 100;
nMotorEncoderTarget[motorC] = 100;

motor[motorB] = 50;
motor[motorC] = 50;
wait1Msec(8000);
}

Author:  BurningLights [ Sun Feb 23, 2014 5:17 pm ]
Post subject:  Re: does this mean go forward for only 100 degrees rotation?

Yes, but if you're planning on using this as part of a larger program, I would recommend removing the wait1Msec() command and replacing it with the following:
Code:
while (nMotorRunState[motorB] != runStateIdle && nMotorRunState[motorC] != runStateIdle){}


This will make the program wait until the motors have stopped moving before continuing the program.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/