public class MaestroServoDriver extends Object implements ServoDriver
for details.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PULSE_WIDTH |
static int |
MIN_PULSE_WIDTH |
protected MaestroServoProvider |
provider |
protected Pin |
servoPin |
Constructor and Description |
---|
MaestroServoDriver(MaestroServoProvider provider,
Pin servoPin) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxValue() |
int |
getMinValue() |
Pin |
getPin() |
int |
getServoPulseResolution()
This is read only value driver is to provide to users of this class.
|
int |
getServoPulseWidth()
This method returns current servo pulse width.
|
boolean |
isMoving() |
void |
setAcceleration(int value) |
void |
setServoPulseWidth(int width)
Sets servo pulse width in resolution provided by
ServoDriver.getServoPulseResolution() . |
void |
setSpeed(int value) |
public static final int MIN_PULSE_WIDTH
public static final int MAX_PULSE_WIDTH
protected Pin servoPin
protected MaestroServoProvider provider
public MaestroServoDriver(MaestroServoProvider provider, Pin servoPin)
public int getServoPulseWidth()
ServoDriver
getServoPulseWidth
in interface ServoDriver
public void setServoPulseWidth(int width)
ServoDriver
ServoDriver.getServoPulseResolution()
.
Zero value may mean that this driver is currently not producing pulse.
Negative values may, generally, be invalid.setServoPulseWidth
in interface ServoDriver
width
- pulse width in resolution read from ServoDriver.getServoPulseResolution()
public int getServoPulseResolution()
ServoDriver
ServoDriver.getServoPulseWidth()
and ServoDriver.setServoPulseWidth(int)
methods are operating in. Resolution is provided in 1/n (ms) where value returned
from this method is n.getServoPulseResolution
in interface ServoDriver
public void setSpeed(int value)
public void setAcceleration(int value)
public boolean isMoving()
public int getMinValue()
public int getMaxValue()
public Pin getPin()
getPin
in interface ServoDriver
Copyright © 2012–2021 Pi4J. All rights reserved.