public class RPIServoBlasterServoDriver extends Object implements ServoDriver
Modifier and Type | Field and Description |
---|---|
protected int |
index |
protected String |
pinString |
protected RPIServoBlasterProvider |
provider |
protected Pin |
servoPin |
protected int |
servoPosition |
Modifier | Constructor and Description |
---|---|
protected |
RPIServoBlasterServoDriver(Pin servoPin,
int index,
String pinString,
RPIServoBlasterProvider provider) |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
setServoPulseWidth(int width)
Sets servo pulse width in resolution provided by
ServoDriver.getServoPulseResolution() . |
protected Pin servoPin
protected int index
protected String pinString
protected int servoPosition
protected RPIServoBlasterProvider provider
protected RPIServoBlasterServoDriver(Pin servoPin, int index, String pinString, RPIServoBlasterProvider provider) throws IOException
IOException
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 Pin getPin()
getPin
in interface ServoDriver
Copyright © 2012–2014 Pi4J. All rights reserved.