Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
master -> mentorSandbox
Browse files Browse the repository at this point in the history
Former-commit-id: c3edda8afc0a235a8c7b126c8ba8b0f38a4770ec
Former-commit-id: d96e61e
  • Loading branch information
rgatkinson committed Nov 29, 2015
2 parents 06bf5f4 + 18868af commit 49ffa84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.hardware.*;
import com.qualcomm.robotcore.util.Range;
import com.qualcomm.robotcore.util.TypeConversion;
import org.swerverobotics.library.BuildConfig;
import org.swerverobotics.library.SynchronousOpMode;
import org.swerverobotics.library.interfaces.*;
Expand Down Expand Up @@ -270,7 +269,7 @@ public synchronized void setServoPosition(int servo, double position)
{
validateServo(servo);
position = Range.clip(position, positionMin, positionMax); // note: runtime formerly threw on range error
double bPosition = Range.scale(position, positionMin, positionMax, bPositionMin, bPositionMax);
double bPosition = Range.scale(position, positionMin, positionMax, regPositionMin, regPositionMax);
this.write(ADDRESS_CHANNEL_MAP[servo], bPosition);
this.pwmEnable();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public class EasyModernServoController extends EasyModernController implements S

public static final double positionMin = 0.0;
public static final double positionMax = 1.0;
public static final byte bPositionMin = 0;
public static final byte bPositionMax = (byte)255;
public static final double regPositionMin = 0;
public static final double regPositionMax = 255;

private List<Servo> servos;
private final double[] servoPositions;
Expand Down Expand Up @@ -233,7 +233,7 @@ public void setServoPosition(int servo, double position)
{
validateServo(servo);
position = Range.clip(position, positionMin, positionMax); // note: runtime formerly threw on range error
double bPosition = Range.scale(position, positionMin, positionMax, bPositionMin, bPositionMax);
double bPosition = Range.scale(position, positionMin, positionMax, regPositionMin, regPositionMax);
this.write(ADDRESS_CHANNEL_MAP[servo], bPosition);
this.pwmEnable();

Expand Down

0 comments on commit 49ffa84

Please sign in to comment.