View unanswered posts | View active topics It is currently Sat Mar 23, 2019 9:23 pm






Reply to topic  [ 5 posts ] 
Motor Encoder Error 
Author Message
Rookie

Joined: Wed Jan 07, 2015 5:52 pm
Posts: 3
Post 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'


Wed Jan 07, 2015 6:22 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Motor Encoder Error
Which version of ROBOTC are you using and on what platform? NXT or EV3?

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Jan 08, 2015 5:41 am
Profile WWW
Rookie

Joined: Wed Jan 07, 2015 5:52 pm
Posts: 3
Post Re: Motor Encoder Error
I am using version 4.27 on the EV3 platform.


Thu Jan 08, 2015 12:57 pm
Profile
Rookie

Joined: Wed Jan 07, 2015 5:52 pm
Posts: 3
Post Re: Motor Encoder Error
Or actually my mistake, I am using RobotC 4.0


Thu Jan 08, 2015 5:03 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Mon Jan 12, 2015 4:06 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.