Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
com.phidgets.ServoPhidget Class Reference
Inheritance diagram for com.phidgets.ServoPhidget:
Inheritance graph
[legend]

List of all members.

Public Member Functions

final void addServoPositionChangeListener (ServoPositionChangeListener l)
native boolean getEngaged (int index) throws PhidgetException
native int getMotorCount () throws PhidgetException
native boolean getMotorOn (int index) throws PhidgetException
native double getPosition (int index) throws PhidgetException
native double getPositionMax (int index) throws PhidgetException
native double getPositionMin (int index) throws PhidgetException
native int getServoType (int index) throws PhidgetException
final void removeServoPositionChangeListener (ServoPositionChangeListener l)
 ServoPhidget () throws PhidgetException
native void setEngaged (int index, boolean state) throws PhidgetException
native void setMotorOn (int index, boolean state) throws PhidgetException
native void setPosition (int index, double position) throws PhidgetException
native void setServoParameters (int index, double minUs, double maxUs, double degrees) throws PhidgetException
native void setServoType (int index, int type) throws PhidgetException

Static Public Attributes

static final int PHIDGET_SERVO_DEFAULT = 1
static final int PHIDGET_SERVO_FIRGELLI_L12_100_100_06_R = 17
static final int PHIDGET_SERVO_FIRGELLI_L12_100_50_06_R = 16
static final int PHIDGET_SERVO_FIRGELLI_L12_30_50_06_R = 13
static final int PHIDGET_SERVO_FIRGELLI_L12_50_100_06_R = 14
static final int PHIDGET_SERVO_FIRGELLI_L12_50_210_06_R = 15
static final int PHIDGET_SERVO_HITEC_805BB = 5
static final int PHIDGET_SERVO_HITEC_815BB = 12
static final int PHIDGET_SERVO_HITEC_HS322HD = 3
static final int PHIDGET_SERVO_HITEC_HS422 = 6
static final int PHIDGET_SERVO_HITEC_HS485HB = 10
static final int PHIDGET_SERVO_HITEC_HS5245MG = 4
static final int PHIDGET_SERVO_HITEC_HS645MG = 11
static final int PHIDGET_SERVO_HITEC_HS785HB = 9
static final int PHIDGET_SERVO_HITEC_HSR1425CR = 8
static final int PHIDGET_SERVO_RAW_us_MODE = 2
static final int PHIDGET_SERVO_SPRINGRC_SM_S2313M = 18
static final int PHIDGET_SERVO_SPRINGRC_SM_S3317M = 19
static final int PHIDGET_SERVO_SPRINGRC_SM_S3317SR = 20
static final int PHIDGET_SERVO_SPRINGRC_SM_S4303R = 21
static final int PHIDGET_SERVO_SPRINGRC_SM_S4315M = 22
static final int PHIDGET_SERVO_SPRINGRC_SM_S4315R = 23
static final int PHIDGET_SERVO_SPRINGRC_SM_S4505B = 24
static final int PHIDGET_SERVO_TOWERPRO_MG90 = 7
static final int PHIDGET_SERVO_USER_DEFINED = 25

Private Member Functions

final void enableDeviceSpecificEvents (boolean b)
native void enableServoPositionChangeEvents (boolean b)
void fireServoPositionChange (ServoPositionChangeEvent e)

Static Private Member Functions

static native long create () throws PhidgetException

Private Attributes

long nativeServoPositionChangeHandler = 0
LinkedList servoPositionChangeListeners = new LinkedList ()

Detailed Description

This class represents a Phidget servo Controller. All methods to control a Servo Controller are implemented in this class.

The Phidget Sevo controller simply outputs varying widths of PWM, which is what most servo motors take as an input driving signal.

Author:
Phidgets Inc.

Definition at line 19 of file ServoPhidget.java.


Constructor & Destructor Documentation

Definition at line 21 of file ServoPhidget.java.


Member Function Documentation

final void com.phidgets.ServoPhidget.addServoPositionChangeListener ( ServoPositionChangeListener  l) [inline]

Adds a servo position change listener. The servo position change handler is a method that will be called when the servo position has changed. The event will get fired after every call to setPosition.

There is no limit on the number of servo position change handlers that can be registered for a particular Phidget.

Parameters:
lAn implemetation of the ServoPositionChangeListener interface

Definition at line 263 of file ServoPhidget.java.

static native long com.phidgets.ServoPhidget.create ( ) throws PhidgetException [static, private]
final void com.phidgets.ServoPhidget.enableDeviceSpecificEvents ( boolean  b) [inline, private]

Reimplemented from com.phidgets.Phidget.

Definition at line 251 of file ServoPhidget.java.

void com.phidgets.ServoPhidget.fireServoPositionChange ( ServoPositionChangeEvent  e) [inline, private]

Definition at line 277 of file ServoPhidget.java.

native boolean com.phidgets.ServoPhidget.getEngaged ( int  index) throws PhidgetException

Returns the engaged state or a servo.

Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Returns the number of motors this Phidget can support. Note that there is no way of programatically determining how many motors are actaully attached to the board.

Returns:
number of motors
native boolean com.phidgets.ServoPhidget.getMotorOn ( int  index) throws PhidgetException
Deprecated:
Replaced by getEngaged
native double com.phidgets.ServoPhidget.getPosition ( int  index) throws PhidgetException

Returns the position of a servo motor. Note that since servo motors do not offer any feedback in their interface, this value is simply whatever the servo was last set to. There is no way of determining the position of a servo that has been plugged in, until it's position has been set. Therefore, if an initial position is important, it should be set as part of initialization.

If the servo is not engaged, the position is unknown and calling this function will throw an exception.

The range here is between getPositionMin and getPositionMax, and corresponds aproximately to an angle in degrees. Note that most servos will not be able to operate accross this entire range.

Parameters:
indexindex of the motor
Returns:
current position of the selected motor
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.
native double com.phidgets.ServoPhidget.getPositionMax ( int  index) throws PhidgetException

Returns the maximum position that a servo will accept, or return.

Parameters:
indexIndex of the servo
Returns:
Maximum position in degrees
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.
native double com.phidgets.ServoPhidget.getPositionMin ( int  index) throws PhidgetException

Returns the minimum position that a servo will accept, or return.

Parameters:
indexIndex of the servo
Returns:
Minimum position in degrees
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.
native int com.phidgets.ServoPhidget.getServoType ( int  index) throws PhidgetException

Returns the servo type for an index. The possible values for type are PHIDGET_SERVO_DEFAULT, PHIDGET_SERVO_RAW_us_MODE, PHIDGET_SERVO_HITEC_HS322HD, PHIDGET_SERVO_HITEC_HS5245MG, PHIDGET_SERVO_HITEC_805BB, PHIDGET_SERVO_HITEC_HS422, etc.

Parameters:
indexInput
Returns:
Servo Type
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.
final void com.phidgets.ServoPhidget.removeServoPositionChangeListener ( ServoPositionChangeListener  l) [inline]

Definition at line 271 of file ServoPhidget.java.

native void com.phidgets.ServoPhidget.setEngaged ( int  index,
boolean  state 
) throws PhidgetException

Engage or disengage a servo motor.

This engages or disengages the servo. The motor is engaged whenever you set a position, use this function to disengage, and reengage without setting a position.

Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.
native void com.phidgets.ServoPhidget.setMotorOn ( int  index,
boolean  state 
) throws PhidgetException
Deprecated:
Replaced by setEngaged
native void com.phidgets.ServoPhidget.setPosition ( int  index,
double  position 
) throws PhidgetException

Sets the position of a servo motor.

The range here is between getPositionMin and getPositionMax, and corresponds aproximately to an angle in degrees. Note that most servos will not be able to operate accross this entire range. Typically, the range might be 25 - 180 degrees, but this depends on the servo

Parameters:
indexindex of the motor
positiondesired position
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index or position is out of range. See open for information on determining if a device is attached.
native void com.phidgets.ServoPhidget.setServoParameters ( int  index,
double  minUs,
double  maxUs,
double  degrees 
) throws PhidgetException

Sets the servo parameters for a custom servo definition.

This constrains the PCM to the valid range of the servo, and sets the degrees-to-PCM ratio to match the actual servo rotation.

Parameters:
indexServo Index
minUsMinimum PCM supported in microseconds
maxUsMaximum PCM supported in microseconds
degreesDegrees of rotation represented by the given PCM range
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.
native void com.phidgets.ServoPhidget.setServoType ( int  index,
int  type 
) throws PhidgetException

Sets the servo type for an index.

This constrains the PCM to the valid range of the servo, and sets the degrees-to-PCM ratio to match the actual servo rotation.

The possible values for type are PHIDGET_SERVO_DEFAULT, PHIDGET_SERVO_RAW_us_MODE, PHIDGET_SERVO_HITEC_HS322HD, PHIDGET_SERVO_HITEC_HS5245MG, PHIDGET_SERVO_HITEC_805BB, PHIDGET_SERVO_HITEC_HS422, etc.

Support for other servo types can be achieved by using setServoParameters.

The default setting is PHIDGET_SERVO_DEFAULT, which is used for historical (backwards compatibility) reasons.

Parameters:
indexInput
typeServo Type
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached.

Member Data Documentation

Definition at line 270 of file ServoPhidget.java.

Default - This is what the servo API been historically used, originally based on the Futaba FP-S148. This is used with getServoType and setServoType

Definition at line 30 of file ServoPhidget.java.

Firgelli L12 Linear Actuator 100mm 100:1. This is used with getServoType and setServoType

Definition at line 94 of file ServoPhidget.java.

Firgelli L12 Linear Actuator 100mm 50:1. This is used with getServoType and setServoType

Definition at line 90 of file ServoPhidget.java.

Firgelli L12 Linear Actuator 30mm 50:1. This is used with getServoType and setServoType

Definition at line 78 of file ServoPhidget.java.

Firgelli L12 Linear Actuator 50mm 100:1. This is used with getServoType and setServoType

Definition at line 82 of file ServoPhidget.java.

Firgelli L12 Linear Actuator 50mm 210:1. This is used with getServoType and setServoType

Definition at line 86 of file ServoPhidget.java.

HiTec HS-805BB Mega Quarter Scale Servo. This is used with getServoType and setServoType

Definition at line 46 of file ServoPhidget.java.

HiTec HS-815BB Mega Sail Servo. This is used with getServoType and setServoType

Definition at line 74 of file ServoPhidget.java.

HiTec HS-322HD Standard Servo. This is used with getServoType and setServoType

Definition at line 38 of file ServoPhidget.java.

HiTec HS-422 Standard Servo. This is used with getServoType and setServoType

Definition at line 50 of file ServoPhidget.java.

HiTec HS-485HB Deluxe Servo. This is used with getServoType and setServoType

Definition at line 66 of file ServoPhidget.java.

HiTec HS-5245MG Digital Mini Servo. This is used with getServoType and setServoType

Definition at line 42 of file ServoPhidget.java.

HiTec HS-645MG Ultra Torque Servo. This is used with getServoType and setServoType

Definition at line 70 of file ServoPhidget.java.

HiTec HS-785HB Sail Winch Servo. This is used with getServoType and setServoType

Definition at line 62 of file ServoPhidget.java.

HiTec HSR-1425CR Continuous Rotation Servo. This is used with getServoType and setServoType

Definition at line 58 of file ServoPhidget.java.

Raw us mode - all position, velocity, acceleration functions are specified in microseconds rather then degrees. This is used with getServoType and setServoType

Definition at line 34 of file ServoPhidget.java.

SpringRC SM-S2313M Micro Servo. This is used with getServoType and setServoType

Definition at line 98 of file ServoPhidget.java.

SpringRC SM-S3317M Small Servo. This is used with getServoType and setServoType

Definition at line 102 of file ServoPhidget.java.

SpringRC SM-S3317SR Small Continuous Rotation Servo. This is used with getServoType and setServoType

Definition at line 106 of file ServoPhidget.java.

SpringRC SM-S4303R Standard Continuous Rotation Servo. This is used with getServoType and setServoType

Definition at line 110 of file ServoPhidget.java.

SpringRC SM-S4315M High Torque Servo. This is used with getServoType and setServoType

Definition at line 114 of file ServoPhidget.java.

SpringRC SM-S4315R High Torque Continuous Rotation Servo. This is used with getServoType and setServoType

Definition at line 118 of file ServoPhidget.java.

SpringRC SM-S4505B Standard Servo. This is used with getServoType and setServoType

Definition at line 122 of file ServoPhidget.java.

Tower Pro MG90 Micro Servo. This is used with getServoType and setServoType

Definition at line 54 of file ServoPhidget.java.

User Defined servo parameters. This is used with getServoType

Definition at line 126 of file ServoPhidget.java.

LinkedList com.phidgets.ServoPhidget.servoPositionChangeListeners = new LinkedList () [private]

Definition at line 269 of file ServoPhidget.java.


The documentation for this class was generated from the following file:


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:23