Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Trouble with Eclipse (Java) (http://www.chiefdelphi.com/forums/showthread.php?t=134516)

BrighidKHeh 13-02-2015 16:07

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?
__________________________

the image is under a word document

Rakusan2 13-02-2015 16:24

Re: Trouble with Eclipse (Java)
 
I do not see rightJoystick being declared
Code:

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

BrighidKHeh 13-02-2015 16:35

Re: Trouble with Eclipse (Java)
 
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.

BrighidKHeh 13-02-2015 17:35

Re: Trouble with Eclipse (Java)!!!
 
Is there anyone who is good at Java and would be willing to use TeamViewer?

Rakusan2 13-02-2015 17:41

Re: Trouble with Eclipse (Java)
 
Are you able to show me the rest of the class?

BrighidKHeh 13-02-2015 17:48

Re: Trouble with Eclipse (Java)
 
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.

Ozuru 13-02-2015 23:54

Re: Trouble with Eclipse (Java)
 
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.

viggy96 15-02-2015 00:31

Did you import the Joystick class?

Fauge7 15-02-2015 00:59

Re: Trouble with Eclipse (Java)
 
you have to create the object outside the constructor like so Oi.java


All times are GMT -5. The time now is 22:31.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi