PhidgetServo

PhidgetServo

A class for controlling a PhidgetServo.  See your product manual for more specific API details, supported functionality, units, etc.

Summary
PhidgetServoA class for controlling a PhidgetServo.
EventsEvents supported by PhidgetServo.
Constants
Servo TypesThese are the some predefined servo motors.
Properties
MotorCountGets the number of motors supported by this controller.
Functions
getPositionGets the current position of a motor.
getEngagedGets the engaged (powered) state of a motor.
getPositionMinGets the minimum position supported by a motor
getPositionMaxGets the maximum position supported by a motor.
getServoTypeGets the servo motor type.
setPositionSets the position of a motor.
setEngagedSets the engaged (powered) state of a motor.
setServoTypeSets the servo type.
setServoParametersSets the servo parameters

Events

Events supported by PhidgetServo.  Pass these constants to the addEventListener() function when adding event listeners to a Phidget object.

PhidgetDataEvent.POSITION_CHANGEposition change

Constants

Servo Types

These are the some predefined servo motors.  Setting one of these will set degree-PCM ratio, min and max angle, and max velocity.  Custom servo parameters can be set with the setServoParameters function.

PHIDGET_SERVO_DEFAULTDefault - This is what the servo API been historically used, originally based on the Futaba FP-S148
PHIDGET_SERVO_RAW_us_MODERaw us mode - all position, velocity, acceleration functions are specified in microseconds rather then degrees
PHIDGET_SERVO_HITEC_HS322HDHiTec HS-322HD Standard Servo
PHIDGET_SERVO_HITEC_HS5245MGHiTec HS-5245MG Digital Mini Servo
PHIDGET_SERVO_HITEC_805BBHiTec HS-805BB Mega Quarter Scale Servo
PHIDGET_SERVO_HITEC_HS422HiTec HS-422 Standard Servo
PHIDGET_SERVO_TOWERPRO_MG90Tower Pro MG90 Micro Servo
PHIDGET_SERVO_HITEC_HSR1425CRHiTec HSR-1425CR Continuous Rotation Servo
PHIDGET_SERVO_HITEC_HS785HBHiTec HS-785HB Sail Winch Servo
PHIDGET_SERVO_HITEC_HS485HBHiTec HS-485HB Deluxe Servo
PHIDGET_SERVO_HITEC_HS645MGHiTec HS-645MG Ultra Torque Servo
PHIDGET_SERVO_HITEC_815BBHiTec HS-815BB Mega Sail Servo
PHIDGET_SERVO_FIRGELLI_L12_30_50_06_RFirgelli L12 Linear Actuator 30mm 50:1
PHIDGET_SERVO_FIRGELLI_L12_50_100_06_RFirgelli L12 Linear Actuator 50mm 100:1
PHIDGET_SERVO_FIRGELLI_L12_50_210_06_RFirgelli L12 Linear Actuator 50mm 210:1
PHIDGET_SERVO_FIRGELLI_L12_100_50_06_RFirgelli L12 Linear Actuator 100mm 50:1
PHIDGET_SERVO_FIRGELLI_L12_100_100_06_RFirgelli L12 Linear Actuator 100mm 100:1
PHIDGET_SERVO_SPRINGRC_SM_S2313MSpringRC SM-S2313M Micro Servo
PHIDGET_SERVO_SPRINGRC_SM_S3317MSpringRC SM-S3317M Small Servo
PHIDGET_SERVO_SPRINGRC_SM_S3317SRSpringRC SM-S3317SR Small Continuous Rotation Servo
PHIDGET_SERVO_SPRINGRC_SM_S4303RSpringRC SM-S4303R Standard Continuous Rotation Servo
PHIDGET_SERVO_SPRINGRC_SM_S4315MSpringRC SM-S4315M High Torque Servo
PHIDGET_SERVO_SPRINGRC_SM_S4315RSpringRC SM-S4315R High Torque Continuous Rotation Servo
PHIDGET_SERVO_SPRINGRC_SM_S4505BSpringRC SM-S4505B Standard Servo
PHIDGET_SERVO_USER_DEFINEDUser defined servo parameters

Properties

MotorCount

public function get MotorCount():int

Gets the number of motors supported by this controller.

Functions

getPosition

public function getPosition(index: int):Number

Gets the current position of a motor.

Parameters

indexmotor index

getEngaged

public function getEngaged(index: int):Boolean

Gets the engaged (powered) state of a motor.

Parameters

indexmotor index

getPositionMin

public function getPositionMin(index: int):Number

Gets the minimum position supported by a motor

Parameters

indexmotor index

getPositionMax

public function getPositionMax(index: int):Number

Gets the maximum position supported by a motor.

Parameters

indexmotor index

getServoType

public function getServoType(index: int):int

Gets the servo motor type.  This is one of the PHIDGET_SERVO_* constants.

Parameters

indexmotor index

setPosition

public function setPosition(index: int,
val: Number):void

Sets the position of a motor.  If the motor is not engaged, this will engage it.

Parameters

indexmotor index
valposition

setEngaged

public function setEngaged(index: int,
val: Boolean):void

Sets the engaged (powered) state of a motor.

Parameters

indexmotor index
valengaged state

setServoType

public function setServoType(index: int,
val: int):void

Sets the servo type.  This is one of the PHIDGET_SERVO_* constants.

Parameters

indexmotor index
valservoType

setServoParameters

public function setServoParameters(index: int,
minUs: Number,
maxUs: Number,
degrees: Number):void

Sets the servo parameters

Parameters

indexmotor index
minUsminimum PCM in microseconds
maxUsmaximum PCM in microseconds
degreestotal range of motion in degrees
Base Phidget class from which all specific device classes inherit.
public function get MotorCount():int
Gets the number of motors supported by this controller.
public function getPosition(index: int):Number
Gets the current position of a motor.
public function getEngaged(index: int):Boolean
Gets the engaged (powered) state of a motor.
public function getPositionMin(index: int):Number
Gets the minimum position supported by a motor
public function getPositionMax(index: int):Number
Gets the maximum position supported by a motor.
public function getServoType(index: int):int
Gets the servo motor type.
public function setPosition(index: int,
val: Number):void
Sets the position of a motor.
public function setEngaged(index: int,
val: Boolean):void
Sets the engaged (powered) state of a motor.
public function setServoType(index: int,
val: int):void
Sets the servo type.
public function setServoParameters(index: int,
minUs: Number,
maxUs: Number,
degrees: Number):void
Sets the servo parameters
Close