|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phidgets.Phidget
com.phidgets.LEDPhidget
This class represents a Phidget LED. All methods to control a Phidget LED are implemented in this class.
The Phidget LED is a board that is meant for driving LEDs. Currently, the only available version drives 64 LEDs, but other versions may become available so this number is not absolute.
LEDs can be controlled individually, at brightness levels from 0-100.
Field Summary | |
static int |
PHIDGET_LED_CURRENT_LIMIT_20mA
20mA current limit. |
static int |
PHIDGET_LED_CURRENT_LIMIT_40mA
40mA current limit. |
static int |
PHIDGET_LED_CURRENT_LIMIT_60mA
60mA current limit. |
static int |
PHIDGET_LED_CURRENT_LIMIT_80mA
80mA current limit. |
static int |
PHIDGET_LED_VOLTAGE_1_7V
1.7V Voltage output. |
static int |
PHIDGET_LED_VOLTAGE_2_75V
2.75V Voltage output. |
static int |
PHIDGET_LED_VOLTAGE_3_9V
3.9V Voltage output. |
static int |
PHIDGET_LED_VOLTAGE_5_0V
5.0V Voltage output. |
Constructor Summary | |
LEDPhidget()
|
Method Summary | |
double |
getBrightness(int index)
Returns the brightness value of an LED. |
int |
getCurrentLimit()
Returns the current limit for the all outputs. |
double |
getCurrentLimit(int index)
Returns the current limit value of an LED. |
int |
getDiscreteLED(int index)
Deprecated. |
int |
getLEDCount()
Returns the number of LEDs that this board can drive. |
int |
getVoltage()
Returns the voltage output for the all outputs. |
void |
setBrightness(int index,
double brightness)
Sets the brightness of an LED. |
void |
setCurrentLimit(int currentLimit)
Sets the current limit for all outputs. |
void |
setCurrentLimit(int index,
double limit)
Sets the current limit of an LED. |
void |
setDiscreteLED(int index,
int brightness)
Deprecated. |
void |
setVoltage(int voltage)
Sets the voltage output for all outputs. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int PHIDGET_LED_CURRENT_LIMIT_20mA
getCurrentLimit
and setCurrentLimit
public static final int PHIDGET_LED_CURRENT_LIMIT_40mA
getCurrentLimit
and setCurrentLimit
public static final int PHIDGET_LED_CURRENT_LIMIT_60mA
getCurrentLimit
and setCurrentLimit
public static final int PHIDGET_LED_CURRENT_LIMIT_80mA
getCurrentLimit
and setCurrentLimit
public static final int PHIDGET_LED_VOLTAGE_1_7V
getVoltage
and setVoltage
public static final int PHIDGET_LED_VOLTAGE_2_75V
getVoltage
and setVoltage
public static final int PHIDGET_LED_VOLTAGE_3_9V
getVoltage
and setVoltage
public static final int PHIDGET_LED_VOLTAGE_5_0V
getVoltage
and setVoltage
Constructor Detail |
public LEDPhidget() throws PhidgetException
Method Detail |
public int getCurrentLimit() throws PhidgetException
PHIDGET_LED_CURRENT_LIMIT_20mA
,
PHIDGET_LED_CURRENT_LIMIT_40mA
, PHIDGET_LED_CURRENT_LIMIT_60mA
and
PHIDGET_LED_CURRENT_LIMIT_80mA
PhidgetException
- If this Phidget is not opened and attached, if the index is out of range, or if unsupported by this board.
See open
for information on determining if a device is attached.public void setCurrentLimit(int currentLimit) throws PhidgetException
The possible values for type are PHIDGET_LED_CURRENT_LIMIT_20mA
,
PHIDGET_LED_CURRENT_LIMIT_40mA
, PHIDGET_LED_CURRENT_LIMIT_60mA
and
PHIDGET_LED_CURRENT_LIMIT_80mA
By default, currentLimit is set to PHIDGET_LED_CURRENT_LIMIT_20mA
.
currentLimit
- Current Limit
PhidgetException
- If this Phidget is not opened and attached, if the index is out of range, or if unsupported by this board.
See open
for information on determining if a device is attached.public int getVoltage() throws PhidgetException
PHIDGET_LED_VOLTAGE_1_7V
,
PHIDGET_LED_VOLTAGE_2_75V
, PHIDGET_LED_VOLTAGE_3_9V
and
PHIDGET_LED_VOLTAGE_5_0V
PhidgetException
- If this Phidget is not opened and attached, if the index is out of range, or if unsupported by this board.
See open
for information on determining if a device is attached.public void setVoltage(int voltage) throws PhidgetException
The possible values for type are PHIDGET_LED_VOLTAGE_1_7V
,
PHIDGET_LED_VOLTAGE_2_75V
, PHIDGET_LED_VOLTAGE_3_9V
and
PHIDGET_LED_VOLTAGE_5_0V
By default, voltage is set to PHIDGET_LED_VOLTAGE_2_75V
.
voltage
- Voltage
PhidgetException
- If this Phidget is not opened and attached, if the index is out of range, or if unsupported by this board.
See open
for information on determining if a device is attached.public int getLEDCount() throws PhidgetException
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public int getDiscreteLED(int index) throws PhidgetException
getBrightness
PhidgetException
public void setDiscreteLED(int index, int brightness) throws PhidgetException
setBrightness
PhidgetException
public double getBrightness(int index) throws PhidgetException
index
- LED
PhidgetException
- If 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.public void setBrightness(int index, double brightness) throws PhidgetException
index
- index of the LEDbrightness
- desired brightness of this LED
PhidgetException
- If this Phidget is not opened and attached, or if the index or brightness value are out of range.
See open
for information on determining if a device is attached.public double getCurrentLimit(int index) throws PhidgetException
index
- LED
PhidgetException
- If 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.public void setCurrentLimit(int index, double limit) throws PhidgetException
index
- index of the LEDlimit
- desired current limit of this LED
PhidgetException
- If this Phidget is not opened and attached, or if the index or limit value are out of range.
See open
for information on determining if a device is attached.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |