public class Leds
extends java.lang.Object
getNumberOfLeds()
. A LED is identified by to its id. The range of the ids is from 0
to
getNumberOfLeds()-1
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_INTENSITY
Maximum intensity that a LED can handle.
|
static int |
MIN_INTENSITY
Intensity value to turn off a LED.
|
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