public class Leds extends Object
getNumberOfLeds()
. A LED is identified by to its identifier. The range of the identifiers is from
0
to getNumberOfLeds()-1
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_INTENSITY
Constant for turning on a LED.
If a LED does not handle intensity, any valid intensity different from MIN_INTENSITY turns the LED on. |
static int |
MIN_INTENSITY
Constant for turning off a LED.
|
Constructor and Description |
---|
Leds() |
Modifier and Type | Method and Description |
---|---|
static int |
getLedIntensity(int ledId)
Gets the intensity of the specified LED.
|
static int |
getNumberOfLeds()
Returns the available number of LEDs.
|
static void |
setLedIntensity(int ledId,
int intensity)
Controls the intensity of the specified LED.
|
static void |
setLedOff(int ledId)
Turns off the given LED.
|
static void |
setLedOn(int ledId)
Turns on the given LED.
|
public static final int MIN_INTENSITY
public static final int MAX_INTENSITY
MIN_INTENSITY
turns the LED on.public static int getNumberOfLeds()
public static void setLedIntensity(int ledId, int intensity)
ledId
- the led identifierintensity
- the intensity to set on the ledpublic static int getLedIntensity(int ledId)
ledId
- the led identifierpublic static void setLedOn(int ledId)
Leds.setLedIntensity(ledId, MAX_INTENSITY)
.ledId
- the led identifierpublic static void setLedOff(int ledId)
Leds.setLedIntensity(ledId, MIN_INTENSITY)
.ledId
- the led identifier