Package com.diozero.devices
Class Servo.Trim
java.lang.Object
com.diozero.devices.Servo.Trim
- Enclosing class:
- Servo
public static class Servo.Trim extends Object
-
Field Summary
Fields Modifier and Type Field Description static Servo.Trim
DEFAULT
static float
DEFAULT_90_DELTA
static float
DEFAULT_MID
static Servo.Trim
MG996R
static float
MID_ANGLE
static Servo.Trim
TOWERPRO_SG5010
static Servo.Trim
TOWERPRO_SG90
-
Constructor Summary
Constructors Constructor Description Trim(float midPulseWidthMs, float ninetyDegPulseWidthMs)
Assumes 180 degree range of movementTrim(float midPulseWidthMs, float ninetyDegPulseWidthMs, float rangePulseWidthMs)
Trim(float midPulseWidthMs, float ninetyDegPulseWidthMs, float minPulseWidthMs, float maxPulseWidthMs)
-
Method Summary
Modifier and Type Method Description float
convertAngleToPulseWidthMs(float angle)
float
convertPulseWidthMsToAngle(float pulseWidthMs)
float
getMaxAngle()
float
getMaxPulseWidthMs()
float
getMidAngle()
float
getMidPulseWidthMs()
float
getMinAngle()
float
getMinPulseWidthMs()
float
getNinetyDegPulseWidthMs()
-
Field Details
-
MID_ANGLE
public static final float MID_ANGLE- See Also:
- Constant Field Values
-
DEFAULT_MID
public static final float DEFAULT_MID- See Also:
- Constant Field Values
-
DEFAULT_90_DELTA
public static final float DEFAULT_90_DELTA- See Also:
- Constant Field Values
-
DEFAULT
-
TOWERPRO_SG90
-
TOWERPRO_SG5010
-
MG996R
-
-
Constructor Details
-
Trim
public Trim(float midPulseWidthMs, float ninetyDegPulseWidthMs)Assumes 180 degree range of movement- Parameters:
midPulseWidthMs
- Pulse width in ms corresponding to the centre position (90 degrees)ninetyDegPulseWidthMs
- Pulse width in ms corresponding to a 90 degreee movement in either direction
-
Trim
public Trim(float midPulseWidthMs, float ninetyDegPulseWidthMs, float rangePulseWidthMs) -
Trim
public Trim(float midPulseWidthMs, float ninetyDegPulseWidthMs, float minPulseWidthMs, float maxPulseWidthMs)
-
-
Method Details
-
getMidPulseWidthMs
public float getMidPulseWidthMs() -
getNinetyDegPulseWidthMs
public float getNinetyDegPulseWidthMs() -
getMinPulseWidthMs
public float getMinPulseWidthMs() -
getMaxPulseWidthMs
public float getMaxPulseWidthMs() -
getMinAngle
public float getMinAngle() -
getMaxAngle
public float getMaxAngle() -
getMidAngle
public float getMidAngle() -
convertPulseWidthMsToAngle
public float convertPulseWidthMsToAngle(float pulseWidthMs) -
convertAngleToPulseWidthMs
public float convertAngleToPulseWidthMs(float angle)
-