Go to Post Define "surgery". I think we have enough close calls with "surgery" as it is. Thank god for disable dongles. - geeknerd99 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 14-02-2016, 13:21
3205patriots 3205patriots is offline
Registered User
FRC #3205
 
Join Date: Jan 2016
Location: Concord
Posts: 6
3205patriots is an unknown quantity at this point
Re: Robot class cannot be instantiated

I narrowed down the subsystem, but I don't understand what the issue could be within it:

package org.usfirst.frc.team3205.robot.subsystems;

import org.usfirst.frc.team3205.robot.RobotMap;
import org.usfirst.frc.team3205.robot.commands.armStart;

import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboar d;

/**
*
*/
public class Arm extends Subsystem {

// Put methods for controlling this subsystem
// here. Call these from Commands.
private DigitalInput armUpperLimit;
private DigitalInput armLowerLimit;
private SpeedController armMover;
private Encoder armEncoder;

public Arm(){
armUpperLimit = new DigitalInput(RobotMap.ARM_UPPER_LIMIT);
//armMiddleLimit = new DigitalInput(RobotMap.ARM_MIDDLE_LIMIT);
armLowerLimit = new DigitalInput(RobotMap.ARM_LOWER_LIMIT);
armMover = new Talon(RobotMap.ARM_MOTOR);
armEncoder = new Encoder(0,0, false, Encoder.EncodingType.k4X); //CHANGE THE ENCODER PORTS
}

public void initDefaultCommand() {
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
setDefaultCommand(new armStart());
}

public boolean isUpperLimitSet(){
return armUpperLimit.get();
}

// public boolean isMiddleLimitSet(){
// return armMiddleLimit.get();
// }

public boolean isLowerLimitSet(){
return armLowerLimit.get();
}

public void moveUp(){
armMover.set(RobotMap.ARM_SPEED);
}

public void moveDown(){
armMover.set(-RobotMap.ARM_SPEED);
}

public void stopMoving(){
armMover.set(0.0);
}

public void resetEncoder(){
armEncoder.reset();
}

public int getEncoder(){
return armEncoder.getRaw();
}

public void updateSmartDashboard(){
SmartDashboard.putNumber("Arm Encoder", getEncoder());
SmartDashboard.putBoolean("Arm Upper Limit", isUpperLimitSet());
//SmartDashboard.putBoolean("Arm Middle Limit", isMiddleLimitSet());
SmartDashboard.putBoolean("Arm Lower Limit", isLowerLimitSet());
SmartDashboard.putNumber("Distance", armEncoder.getDistance());

}
}
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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