From 46bd2ba42d186a81d7ad7e4a55e03dd63b2d042f Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Sun, 3 Mar 2013 19:30:43 +0000 Subject: Imported Upstream version 2.1.8.20121218 --- Java/com/phidgets/LEDPhidget.java | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'Java/com/phidgets/LEDPhidget.java') diff --git a/Java/com/phidgets/LEDPhidget.java b/Java/com/phidgets/LEDPhidget.java index a1530f3..d26ce90 100644 --- a/Java/com/phidgets/LEDPhidget.java +++ b/Java/com/phidgets/LEDPhidget.java @@ -1,6 +1,6 @@ /* - * Copyright 2012 Phidgets Inc. All rights reserved. + * Copyright 2006 Phidgets Inc. All rights reserved. */ package com.phidgets; @@ -16,9 +16,6 @@ import com.phidgets.event.*; so this number is not absolute.

LEDs can be controlled individually, at brightness levels from 0-100. - * See your device's User Guide for more specific API details, - * technical information, and revision details. The User Guide, along with other resources, can be found on - * the product page for your device. * * @author Phidgets Inc. */ @@ -120,6 +117,14 @@ public final class LEDPhidget extends Phidget * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. */ public native int getLEDCount () throws PhidgetException; + /** + * Deprecated. Use {@link #getBrightness getBrightness} + */ + public native int getDiscreteLED (int index) throws PhidgetException; + /** + * Deprecated. Use {@link #setBrightness setBrightness} + */ + public native void setDiscreteLED (int index, int brightness) throws PhidgetException; /** * Returns the brightness value of an LED. This value ranges from 0-100. * @param index LED @@ -127,17 +132,33 @@ public final class LEDPhidget extends Phidget * @throws PhidgetException If this Phidget is not opened and attached, or if the index is out of range. * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. */ - public native int getDiscreteLED (int index) throws PhidgetException; + public native double getBrightness (int index) throws PhidgetException; /** * Sets the brightness of an LED. - * Valid values are 0-100, with 0 being off and 100 being the brightest. This 0-100 value is converted internally to a - 6-bit value (0-63) so only 64 levels of brightness are actually possible. + * Valid values are 0-100, with 0 being off and 100 being the brightest. * @param index index of the LED * @param brightness desired brightness of this LED - * @throws PhidgetException If this Phidget is not opened and attached, or if the index of brightness value are out of range. + * @throws PhidgetException If this Phidget is not opened and attached, or if the index or brightness value are out of range. * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. */ - public native void setDiscreteLED (int index, int brightness) throws PhidgetException; + public native void setBrightness (int index, double brightness) throws PhidgetException; + /** + * Returns the current limit value of an LED. This value ranges from 0-80 mA. + * @param index LED + * @return current limit + * @throws PhidgetException If this Phidget is not opened and attached, or if the index is out of range. + * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. + */ + public native double getCurrentLimit (int index) throws PhidgetException; + /** + * Sets the current limit of an LED. + * Valid values are 0-80 mA. + * @param index index of the LED + * @param limit desired current limit of this LED + * @throws PhidgetException If this Phidget is not opened and attached, or if the index or limit value are out of range. + * See {@link com.phidgets.Phidget#open(int) open} for information on determining if a device is attached. + */ + public native void setCurrentLimit (int index, double limit) throws PhidgetException; private final void enableDeviceSpecificEvents (boolean b) { } -- cgit v1.2.3