Help with [Ch4] error. the front right motor doesn't work while the other motors are working. Any suggestions?

task main()

//Loop Forever
while(1 == 1)
	//Remote Control Commands
	motor[frontRight] = vexRT[Ch3] - vexRT[Ch1] - vexRT[Ch4];
	motor[backRight] =  vexRT[Ch3] - vexRT[Ch1] + vexRT[Ch4];
	motor[frontLeft] = vexRT[Ch3] + vexRT[Ch1] + vexRT[Ch4];
	motor[backLeft] =  vexRT[Ch3] + vexRT[Ch1] - vexRT[Ch4];


I think you muscategorized this post. This looks to be ROBOTC (with Cortex) and not VCS. Correct?

Anyway, you are subtracting a lot of values. Are you sure you aren’t just bottoming out at 0 for the motor speed? I would set a variable printout equal to the motor speed and watch it as you do different things with the controls.

Alright thanks for the tip this is my first time using the forum so sorry about the categorization, the Robot C errors says that ‘short’ is assumed so I don’t think its a speed problem.

Oh. Then it’s probably that you didn’t name the motor correctly in your motor and sensor setup. Can you check that out and make sure it’s EXACTLY the same as what you have written in the code?
You probably mistyped somewhere. It should be an easy fix.

If this isn’t the problem, can you say exactly what the error tells you?

This is the error message, the name of the motor matches. But its only for this motor

Error:Undefined variable ‘Ch3’. ‘short’ assumed.
Error:Undefined variable ‘Ch1’. ‘short’ assumed.
Error:Undefined variable ‘Ch4’. ‘short’ assumed.

Are you in the right platform? Does it say that on every line or just the one?

Just the one line of code

Sorry, no clue as to why that would only find error in the first usage of the channels.

Try to comment that first line out and recompile. See if it works without that first line. If so, I have no clue what the issue could be.

The next line of code has an error mark instead now.

Okay. That’s good because it’s not just one line.

Go into Platform Type and make sure you’re using the 2.0 Cortex or whatever you’re using.

Then, go into the command library (on the left side of the screen) and make sure the syntax for the joystick channel call is correct. I don’t have RobotC in front of me, otherwise I would confirm for you.

1 Like

It’s working now. Thank you

Was it the platform type?

I was using VEX IQ instead of Cortex 2.0

That’ll do it. My RobotC defaults to that sometimes, too. At least you(we) got it figured out!

1 Like

Thank you so much for your help!