Phidget

Base Phidget class from which all specific device classes inherit.  See the programming manual for more specific API details, supported functionality, units, etc.

Summary
PhidgetBase Phidget class from which all specific device classes inherit.
EventsEvents supported by all Phidgets.
Functions
openOpens a Phidget.
closeCloses a Phidget.
Properties
TypeGets the type (class) of a Phidget.
NameGets the specific name of a Phidget.
LabelGets the Label of a Phidget.
VersionGets the firwmare version of a Phidget.
serialNumberGets the unique serial number of a Phidget.
isAttachedGets the attached state of a Phidget.
AddressGets the server address.
PortGets the server port.
LabelSets the Label.

Events

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

PhidgetEvent.CONNECTserver connect
PhidgetEvent.DISCONNECTserver disconnect
PhidgetEvent.ATTACHphidget attach
PhidgetEvent.DETACHphidget detach
PhidgetErrorEvent.ERRORasynchronous error

Functions

open

public function open(address: String,  
port: Number,  
password: String = null,
serialNumber: int = com.phidgets.Constants.PUNK_INT,
label: String = null):void

Opens a Phidget.

Parameters

addressaddress of the webservice.  This can be ‘localhost’ when running from a single computer.
portport of the webservice.  This is 5001 by default.
passwordpassword of the webservice.  This is optional and doesn’t need to be specified for unsecured webservices.
serialNumberserial number of the phidget to open.  This is optional and if not specified, the first available phidget will be opened.

close

public function close():void

Closes a Phidget.  This closes the connection to a Phidget, and to the server.

Properties

Type

public function get Type():String

Gets the type (class) of a Phidget.

Name

public function get Name():String

Gets the specific name of a Phidget.

Label

public function get Label():String

Gets the Label of a Phidget.

Version

public function get Version():int

Gets the firwmare version of a Phidget.

serialNumber

public function get serialNumber():int

Gets the unique serial number of a Phidget.

isAttached

public function get isAttached ():Boolean

Gets the attached state of a Phidget.

Address

public function get Address():String

Gets the server address.

Port

public function get Port():int

Gets the server port.

Label

public function set Label(str: String):void

Sets the Label.  Note that this is only supported on some systems.

A class for controlling a PhidgetAccelerometer.
A class for controlling a PhidgetAdvancedServo.
A class for controlling a PhidgetAnalog.
A class for controlling a PhidgetBridge.
public function open(address: String,  
port: Number,  
password: String = null,
serialNumber: int = com.phidgets.Constants.PUNK_INT,
label: String = null):void
Opens a Phidget.
public function close():void
Closes a Phidget.
public function get Type():String
Gets the type (class) of a Phidget.
public function get Name():String
Gets the specific name of a Phidget.
public function get Label():String
Gets the Label of a Phidget.
public function get Version():int
Gets the firwmare version of a Phidget.
public function get serialNumber():int
Gets the unique serial number of a Phidget.
public function get isAttached ():Boolean
Gets the attached state of a Phidget.
public function get Address():String
Gets the server address.
public function get Port():int
Gets the server port.
Close