Mismatched typedefs in RobotC

#1

#pragma config(Motor, port2, backrightwheel, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, backleftwheel, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, leftout, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, leftup, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, frontleftwheel, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, rightout, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, rightup, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, frontrightwheel, tmotorVex393_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

task main()
{
while(1==1)
{
motor[frontleftwheel]=vexRT[Ch3];
motor[backleftwheel]=vexRT[Ch3];
motor[frontrightwheel]=vexRT[Ch2];
motor[backrightwheel]=vexRT[Ch2];

	if(Btn5U==1)
	{
		motor[leftout]=127;				
		motor[rightout]=127;
	}
	else
	{
		motor[leftout]=0;				
		motor[rightout]=0;
	}
	if(Btn5D==1)
	{
		motor[leftout]=-127;
		motor[rightout]=-127;
	}

	else
	{
		motor[leftout]=0;
		motor[rightout]=0;
	}
	if(Btn6U==1)
	{
		motor[leftup]=127;
		motor[rightup]=127;
	}
	else
	{
		motor[leftup]=0;
		motor[rightup]=0;
	}
	if(Btn6D==1)
	{
		motor[leftup]=-127;
		motor[rightup]=-127;
	}
	else
	{
		motor[leftup]=0;
		motor[rightup]=0;
	}
}

}

I received an error message for the first “if” statement, saying that there were mismatched typedefs.
Here is the entire message:
Warning:Mismatched typedefs. Converting typedef ‘char’ to typedef ‘TVexJoysticks’, value ‘Ch2’”

1 Like

#2

I don’t see anything wrong with the drivetrain portion. Are you measuring joystick values anywhere else?
(Moved to robotc tech support)

0 Likes

#3

@MLGDolphinStudios, I am not sure why it complained about ‘Ch2’ but your if() statments should use vexRT[…] array when testing button values:

if( vexRT[Btn5U]==1)
{
  ...
}

Here is the RobotC reference page: http://www.robotc.net/wikiarchive/VEX2_Functions_Remote_Control_-_VEXnet

3 Likes

#4

Nope, just for the 4 motors that control the wheels for movement.

0 Likes

#5

Thank you, I’ll try that next chance I get and see how it works.

0 Likes