public class Arm extends Subsystem {
private CANJaguar left, right;
- ArrayList<DigitalInput> limitSwitches;
+ private ArrayList<DigitalInput> limitSwitches;
//channel index numbers correspond to limit switches
- int[] channels;
+ private int[] channels;
+ private int currentLevel;
private final int NUM_OF_SWITCHES = 4;
public Arm() {
right.set(0);
}
+ //should run in robot.java teleop periodic (autonomous periodic too maybe?)
+ public void updateLimitSwitches(){
+ for(int i = 0; i < NUM_OF_SWITCHES; i ++){
+ DigitalInput d = limitSwitches.get(i);
+ if(d.get()){
+ currentLevel = i;
+ }
+ }
+ }
+
public int getLevel(){
//return last past switch
return 0;