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

Pairing 2 Vexnet Joysticks using RobotC 2.31
http://www.robotc.net/forums/viewtopic.php?f=53&t=3287
Page 1 of 1

Author:  amcclure [ Mon May 23, 2011 6:36 pm ]
Post subject:  Pairing 2 Vexnet Joysticks using RobotC 2.31

We upgraded RobotC to 2.31 and now our pairing code will no longer work. Here is an example of the code.

if(vexRT[btn6uXmtr2]==1)
{
motor[Rt]=127;
motor[Lt]=-127;
}
else if(vexRT[btn6dXmtr2]==1)
{
motor[Rt]=-127;
motor[Lt]=127;
}
else
{
motor[Rt]=0;
motor[Lt]=0;
}

Here is the error message we now get. **Error**:Undefined variable 'btn6uXmtr2'. 'short' assumed.

Any help would be great.

Author:  RoboDesigners [ Mon May 23, 2011 6:49 pm ]
Post subject:  Re: Pairing 2 Vexnet Joysticks using RobotC 2.31

Quote:
**Error**:Undefined variable 'btn6uXmtr2'. 'short' assumed.

This error typically means the programmer misspelled something (or, which may be this case, ROBOTC changed the syntax when updating). The way to reference the buttons for the 2nd joystick has the b and u capitalized. (i.e. vexRT[Btn6UXmtr2])

Hope this helps,
Andrew

Author:  amcclure [ Tue May 24, 2011 11:19 am ]
Post subject:  Re: Pairing 2 Vexnet Joysticks using RobotC 2.31

Andrew Thanks. That took away the "yellow" Spelling errors on the teacher station but we still get the same error on the student stations. Could there be a setting that needs to be changed? It looks like we have the correct code.

Andy

Author:  RoboDesigners [ Tue May 24, 2011 4:55 pm ]
Post subject:  Re: Pairing 2 Vexnet Joysticks using RobotC 2.31

amcclure wrote:
Could there be a setting that needs to be changed? It looks like we have the correct code.

On the "student" computers (the ones that still show the errors), make sure that you've selected "Cortex" as the micro-controller under "Robot > Platform Type > VEX 2.0 Cortex."

Andrew

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