package org.usfirst.frc.team4828;

import edu.wpi.first.wpilibj.Servo;

public class ServoGroup {
    private static final double STEP_SIZE = 0.01;

    private Servo master;
    private Servo slave;
    private double[] masterRange;
    private double[] slaveRange;
    private double position;

    ServoGroup(int masterPort, int slavePort) {
        master = new Servo(masterPort);
        slave = new Servo(slavePort);
        masterRange = new double[2];
        slaveRange = new double[2];
    }

    ServoGroup(int masterPort, int slavePort, double masterMin, double masterMax, double slaveMin, double slaveMax) {
        master = new Servo(masterPort);
        slave = new Servo(slavePort);
        masterRange = new double[2];
        slaveRange = new double[2];
        calibrate(1, masterMin, masterMax);
        calibrate(2, slaveMin, slaveMax);
        position = 0;
    }

    public void raise(double step) {
        set(position + step);
    }

    public void raise() {
        raise(STEP_SIZE);
    }

    public void lower(double step) {
        set(position - step);
    }

    public void lower() {
        lower(STEP_SIZE);
    }


    public void set(double pos) {
        position = pos;
        master.set((masterRange[1] - masterRange[0]) * position + masterRange[0]);
        slave.set((slaveRange[1] - slaveRange[0]) * position + slaveRange[0]);
    }

    public double get() {
        return position;
    }

    /**
     * Configure the servos' range of motion.
     *
     * @param sel 0 = master 1 = slave
     * @param min double lowest angle
     * @param max double highest angle
     */
    public void calibrate(int sel, double min, double max) {
        if (sel == 1) {
            masterRange[0] = min;
            masterRange[1] = max;
        } else {
            slaveRange[0] = min;
            slaveRange[1] = max;
        }
    }

    public String toString() {
        return "Master: " + master.get() + " Slave: " + slave.get();
    }

}

@@ -888,270 +888,726 @@
     
-public void raise(double step) %7B%0A        set(position + step);%0A    %7D%0A%0A    public void raise() %7B%0A        raise(STEP_SIZE);%0A    %7D%0A%0A    public void lower(double step) %7B%0A        set(position - step);%0A    %7D%0A%0A    public void lower() %7B%0A        lower(STEP_SIZE);%0A    %7D%0A%0A
+/**%0A     * Raises the servos by a given step size%0A     *%0A     * @param step double step size%0A     */%0A    public void raise(double step) %7B%0A        set(position + step);%0A    %7D%0A%0A    /**%0A     * Raises the servos by the default step size%0A     */%0A    public void raise() %7B%0A        raise(STEP_SIZE);%0A    %7D%0A%0A    /**%0A     * Lowers the servos by a given step size%0A     *%0A     * @param step double step size%0A     */%0A    public void lower(double step) %7B%0A        set(position - step);%0A    %7D%0A%0A    /**%0A     * Lowers the servos by the default step size%0A     */%0A    public void lower() %7B%0A        lower(STEP_SIZE);%0A    %7D%0A%0A    /**%0A     * Set the servos' position%0A     *%0A     * @param pos double 0-1 relative position within range%0A     */
 %0A   
@@ -1822,32 +1822,122 @@
 nge%5B0%5D);%0A    %7D%0A%0A
+    /**%0A     * Returns the current position%0A     *%0A     * @return double position%0A     */%0A
     public doubl
@@ -2057,17 +2057,17 @@
 ram sel 
-0
+1
  = maste
@@ -2067,18 +2067,19 @@
 = master
- 1
+, 2
  = slave
@@ -2413,24 +2413,128 @@
    %7D%0A    %7D%0A%0A
+    /**%0A     * Returns a String stating the position of each servo%0A     *%0A     * @return String%0A     */%0A
     public S

Add some Javadocs to ServoGroup