PhidgetIR

PhidgetIR

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

Summary
PhidgetIRA class for controlling a PhidgetIR.
EventsEvents supported by PhidgetIR.
Properties
LastCodeGets the last code received.
LastLearnedCodeGets the last code received.
Functions
readRawRead raw IR data.
transmitTransmit an IR code.
transmitRepeatTransmit a repeat code.
transmitRawTransmit raw data.

Events

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

PhidgetDataEvent.CODEcode
PhidgetDataEvent.RAW_DATAraw data
PhidgetDataEvent.LEARNlearned code

Properties

LastCode

public function get LastCode():PhidgetIRCode

Gets the last code received.

LastLearnedCode

public function get LastLearnedCode():PhidgetIRLearnedCode

Gets the last code received.

Functions

readRaw

public function readRaw(buffer: Array,  
offset: int = 0,
count: int = -1):int

Read raw IR data.  Read data always starts with a space and ends with a pulse.

parameters

bufferan array to read data into
offsetoffset in array to start writing data.  Defaults to 0 (start of array);
countmaximum ammount of data to read.  Defaults to size of array.

Returns

The ammount of data actually read.

transmit

public function transmit(code: String,
codeInfo: PhidgetIRCodeInfo):void

Transmit an IR code.

parameters

codethe code to transmit.  Right-justified hex string (same format as codes coming in).
codeInfocode information.

transmitRepeat

public function transmitRepeat():void

Transmit a repeat code.  Call after calling transmit.  Make sure to pause at least 20ms between calls to this function

transmitRaw

public function transmitRaw(data: Array,  
carrierFrequency: int = 0,
dutyCycle: int = 0,
gap: int = 0):void

Transmit raw data.  Use this for codes that cannot be specified using a PhidgetIRCodeInfo object.

parameters

datathe raw data to transmit.  Data is in microseconds, and must start and end with a pulse.
carrierFrequencycarrier frequency to use.  Optional, defaults to 38000kHz.
dutyCycleduty cycle to use.  Optional, defaults to 33%.
gapgap length to maintain after data is transmitted.  Optional, default is 0.
Base Phidget class from which all specific device classes inherit.
public function get LastCode():PhidgetIRCode
Gets the last code received.
public function get LastLearnedCode():PhidgetIRLearnedCode
Gets the last code received.
public function readRaw(buffer: Array,  
offset: int = 0,
count: int = -1):int
Read raw IR data.
public function transmit(code: String,
codeInfo: PhidgetIRCodeInfo):void
Transmit an IR code.
public function transmitRepeat():void
Transmit a repeat code.
public function transmitRaw(data: Array,  
carrierFrequency: int = 0,
dutyCycle: int = 0,
gap: int = 0):void
Transmit raw data.
Close