Log in

View Full Version : all most thar, plez help


BrandonD-1528
06-02-2009, 09:15
All of our teams vetrens mebers graduwated last year and we have no programing mentor, were so close to geting our cood working, were down to the last 5 err0rs and eney help would be gratly apresheated.

if (leftStick.GetY() >= (1 - k))
{
leftMotor.set(leftStick.GetY());
}
error: 'leftmotor' undeclared (first use this function)

if ((leftStick(1).GetY() < (1 - k)) && (leftStick.GetY() > k))
{
if (leftStick.GetY() > leftMotor.get())
{
error:no mach for call to '(joystik)(int)'

if (rightStick.GetY() >= (1 - k))

{
rightMotor.set(rightStick.GetY());
}
error: rightStick undeclared(first use this function)
error: rightMotor undeclared(first use this function)
Start_Robot_Class(RobotDemo);
error:new types may not be defined in a return type.

martin417
06-02-2009, 09:26
Brandon,

I can't help with your code, but may I suggest you refrain from "cute" spelling and grammar? (I am giving you the benefit of the doubt here, that your atrocious grammar and spelling are intentional). Someone may see your post and assume that you don't care enough to put the effort of proper English into asking for help, and may be unwilling to put forth the effort to help.

(puts on flame suit in preparation for expected attacks)

Racer26
06-02-2009, 09:46
It sounds to me as though you have not declared your left and right motors
you would have to use something like:

Jaguar leftMotor*;
Jaguar rightMotor*;

This goes in the class components, at the top of the RobotDemo class

then you put:

leftMotor = new Jaguar(1);
rightMotor = new Jaguar(2);

You put this with the other declarations in the "RobotDemo" class constructor.

also, it sounds like your right joystick is also not defined. you would have to use

Joystick rightStick*;

rightStick = new Joystick(2);

in the same two places mentioned above.

Your second error is because you're calling leftStick(1).GetY(), instead of just leftStick.GetY();

BrandonD-1528
06-02-2009, 09:53
Sorry i am dyslexic the worst in the hole tristate rigon and i forgot to spell check the title and did not mean to sound "cute".

BrandonD-1528
06-02-2009, 10:05
thank you we fix these errors but does any one know whats up with the last error.

Racer26
06-02-2009, 12:14
Its hard for us to tell without seeing the rest of your code. I recommend posting your entire CPP file, as its usually the result of some minor syntax error.