package com.rmrobotics.library;

import com.qualcomm.robotcore.hardware.Servo;
import com.qualcomm.robotcore.util.Range;

/**
 * Created by RM Robotics on 11/23/2015.
 */

public class rServo extends Servo {

    private double minPower;
    private double maxPower;
    private double desiredPower;
    private double currentPower;
    private boolean isContinuous;

    public rServo(boolean x) {
        isContinuous = x;
        if (!isContinuous) {
            maxPower = 0.9;
            minPower = 0.1;
        } else {
            maxPower = 1;
            minPower = 0.1;
        }
    }

    public void set(double x) {
        desiredPower = x;
        currentPower = Range.clip(desiredPower, minPower, maxPower);
        setPosition(currentPower);
    }
}
@@ -188,25 +188,181 @@
 ervo
- extends Servo %7B%0A
+%7B%0A%0A    private static final double MAX_POWER = 1.0;%0A    private static final double MIN_POWER = 0.1;%0A%0A    private Servo parent;%0A    private Servo.Direction defaultDirection;
 %0A   
@@ -535,16 +535,25 @@
  rServo(
+Servo s, 
 boolean 
@@ -554,19 +554,38 @@
 olean x)
- 
 %7B%0A
+        parent = s;%0A
         
@@ -612,17 +612,16 @@
       if
- 
 (!isCont
@@ -627,17 +627,16 @@
 tinuous)
- 
 %7B%0A      
@@ -744,34 +744,32 @@
     minPower = 0
-.1
 ;%0A        %7D%0A    
@@ -856,18 +856,18 @@
 r = 
-Range.clip
+speedCheck
 (des
@@ -879,58 +879,130 @@
 ower
-, minPower, maxPower);
+);%0A        //TODO feed power to servo
 %0A    
+%7D%0A%0A
     
-setPosition(current
+private double speedCheck(double p)%7B%0A        p = Range.clip(minPower, max
 Powe
@@ -1011,9 +1011,10 @@
 ;%0A    %7D%0A
+%0A
 %7D

Revert back to custom class servo