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

Motor Encoder Error
http://robotc.net/forums/viewtopic.php?f=1&t=10197
Page 1 of 1

Author:  DavidC1217 [ Wed Jan 07, 2015 6:22 pm ]
Post subject:  Motor Encoder Error

I'm trying to get a simple motor encoder code to work, but it I keep getting the same error message. Here is my code:

void stopAfterDistance(float encoderDistance){
resetMotorEncoder(rightMotor);//14 cm forward
resetMotorEncoder(leftMotor);
setMotorTarget(motorA, 1000, 50);
waitUntilMotorStop(rightMotor);
wait10Msec(20);
nMotorEncoder [rightMotor] = 0;
nMotorEncoder [leftMotor] = 0;

Here is the error message, I know it has something to do with the nSpeed parameter, but I can't f it is need to change.

**Error**:Multiple overloads for 'setMotorTarget' match [including some typedef promotions]
*Warning*:Selected: setMotorTarget(tMotor nMotorIndex, float nPosition, short nSpeed)
Converted:4000104/3/300 (Parm/Const/Indirect) Converting variable 'nSpeed' from numeric 'char' to numeric 'short'
*Warning*:Worse: setMotorTarget(tMotor nMotorIndex, float nPosition, short nSpeed)
Converted:4000104/3/300 (Parm/Const/Indirect) Converting variable 'nSpeed' from numeric 'char' to numeric 'short'

Author:  mightor [ Thu Jan 08, 2015 5:41 am ]
Post subject:  Re: Motor Encoder Error

Which version of ROBOTC are you using and on what platform? NXT or EV3?

= Xander

Author:  DavidC1217 [ Thu Jan 08, 2015 12:57 pm ]
Post subject:  Re: Motor Encoder Error

I am using version 4.27 on the EV3 platform.

Author:  DavidC1217 [ Thu Jan 08, 2015 5:03 pm ]
Post subject:  Re: Motor Encoder Error

Or actually my mistake, I am using RobotC 4.0

Author:  mightor [ Mon Jan 12, 2015 4:06 am ]
Post subject:  Re: Motor Encoder Error

Please upgrade to the latest: http://downloads.robotc.net/lego/ROBOTC ... 28Beta.exe

Also, please include the ENTIRE program, not just the one snippet, it really helps with the problem solving.

= Xander

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