Trouble with Eclipse (Java)

public Joystick joystick1;
public JoystickButton NoodleOn;
public JoystickButton NoodleOff;
public Joystick LiftArm;
public Joystick joystick2;
}
public IO() {
rightJoystick = new Joystick(1);
joystick2 = new Joystick(2);
NoodleOn = new JoystickButton(joystick2, 3);
NoodleOn.whileHeld(new NoodleOn());


The two bolded Joysticks (joystick(1) and joystick(2)) contain errors. The errors says “cannot instantiate the type joystick”. The code shouldn’t be producing errors, and joystick.class is under the WPILIB like it should be. Any solutions?


http://Libraries\Pictures
the image is under a word document

I do not see rightJoystick being declared

public Joystick rightJoystick;

also this year the numbering for joysticks is 0-based meaning that the 1st joystick is Joystick(0)

public Joystick rightJoystick;
public JoystickButton NoodleOn;
public JoystickButton NoodleOff;
public Joystick ArmUpDown;
public Joystick leftJoystick;
}
public IO() {
rightJoystick = new Joystick(1);
leftJoystick = new Joystick(2);
NoodleOn = new JoystickButton(2, 3);
NoodleOn.whileHeld(new NoodleOn());
ArmUpDown = new Joystick(1);


The bolded joysticks all have the same error still. “Cannot instantiate the type joystick”. Also, when I click on joystick.class under WPILib, I get a page that says “Source not found - The JAR file has no source attachment”. I don’t know if this makes a difference or not.

Is there anyone who is good at Java and would be willing to use TeamViewer?

Are you able to show me the rest of the class?

public class ArmDown extends Command {
public ArmDown() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
requires(Robot.noodleAndToteSystems);
}

// Called just before this Command runs the first time
protected void initialize() {
}

// Called repeatedly when this Command is scheduled to run
protected void execute() {
    Robot.noodleAndToteSystems.SetArmMotorSpeed(-1);
}

// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
    return false;
}

// Called once after isFinished returns true
protected void end() {
    Robot.noodleAndToteSystems.SetArmMotorSpeed(0);
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
	return arm.limitSwitch3;
	return arm.limitSwitch4;
    end();
}

}


The error is at the top of this page, and every other page in the program.

Well, the first thing I’ve noticed is that your Joystick ports are off – it starts at a zero-index so Joystick 1 is in port 0 and Joystick 2 is in port 1.

Did you import the Joystick class?

you have to create the object outside the constructor like so Oi.java