I just also tried to find Motor commands for motor rotating to a encoder target but can't find the proper cmd:
I expected sth like
Code: Select all
RotateToEncoderTarget(char port, char PwrPerc, long Target)
RotateToEncoderTarget(OUT_A, 80, 7890)
Code: Select all
RotateToEncoderTarget(char port, char PwrPerc, long Target)
RotateToEncoderTarget(OUT_A, 80, 7890)
RotateToEncoderTarget(OUT_A, 80, 7890)
RotateMotor is the big daddydoc-helmut wrote:which family member (son, daughter, grandma, nephew) and how specifically?
e.g.RotateToEncoderTarget(OUT_A, 80, 7890)
doc-helmut wrote:Just get specific an detailed, how is the code to be written for RotateToEncoderTarget(OUT_A, 80, 7890)?
Why don't you want to write t explicitely?
Or is it too complicated to write?
Question wasn't clear (since it didn't say relative or absolute). The word target can be used in any case. I shouldn't even answer, but I think we had this before: Keep one of the three counters (probably best to use MotorRotationCount, also an NXC function) running and don't reset it (that's perfectly possible, you still got TachoCount to reset, BlockTachoCount is reserved for sync driving).doc-helmut wrote:I guess you miss understand:
I don't want it to ratate 7890 relatively but to an absolute target regardless of the current counter value!
Code: Select all
absoluteTarget = 7890;
power = 80;
relativeTarget = absoluteTarget - MotorRotationCount(OUT_A);
if (relativeTarget < 0) {
power = -power;
relativeTarget = - relativeTarget;
}//end if
RotateMotor(OUT_A, power, relativeTarget);
Users browsing this forum: No registered users and 2 guests