public class MatrixServoController extends java.lang.Object implements ServoController
ServoController.PwmStatus
HardwareDevice.Manufacturer
Modifier and Type | Field and Description |
---|---|
protected ServoController.PwmStatus |
pwmStatus |
static int |
SERVO_POSITION_MAX |
protected double[] |
servoCache |
Constructor and Description |
---|
MatrixServoController(MatrixMasterController master) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this device
|
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
ServoController.PwmStatus |
getPwmStatus()
Returns the enablement status of the collective set of servos connected to this controller
|
double |
getServoPosition(int channel)
Get the position of a servo at a given channel
|
int |
getVersion()
Version
|
void |
handleReadServo(MatrixI2cTransaction transaction,
byte[] buffer) |
void |
pwmDisable()
Disables all of the servos connected to this controller
|
void |
pwmEnable()
Enables all of the servos connected to this controller
|
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
void |
setServoPosition(int channel,
double position)
Set the position of a servo at the given channel
|
void |
setServoPosition(int channel,
double position,
byte speed) |
public static final int SERVO_POSITION_MAX
protected ServoController.PwmStatus pwmStatus
protected double[] servoCache
public MatrixServoController(MatrixMasterController master)
public void pwmEnable()
ServoController
pwmEnable
in interface ServoController
public void pwmDisable()
ServoController
pwmDisable
in interface ServoController
public ServoController.PwmStatus getPwmStatus()
ServoController
getPwmStatus
in interface ServoController
public void setServoPosition(int channel, double position)
ServoController
setServoPosition
in interface ServoController
channel
- channel of servoposition
- from 0.0 to 1.0public void setServoPosition(int channel, double position, byte speed)
public double getServoPosition(int channel)
ServoController
getServoPosition
in interface ServoController
channel
- channel of servopublic HardwareDevice.Manufacturer getManufacturer()
HardwareDevice
getManufacturer
in interface HardwareDevice
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
public java.lang.String getConnectionInfo()
HardwareDevice
getConnectionInfo
in interface HardwareDevice
public int getVersion()
HardwareDevice
getVersion
in interface HardwareDevice
public void resetDeviceConfigurationForOpMode()
HardwareDevice
resetDeviceConfigurationForOpMode
in interface HardwareDevice
public void close()
HardwareDevice
close
in interface HardwareDevice
public void handleReadServo(MatrixI2cTransaction transaction, byte[] buffer)