Package ej.microui.led

## Class Leds

- java.lang.Object
- - ej.microui.led.Leds

-     public class Leds
      extends Object

  This class is used to manage all LEDs available on the platform. The available number of LEDs is known thanks to the method `getNumberOfLeds()`. A LED is identified by to its identifier. The range of the identifiers is from `0` to `getNumberOfLeds()-1`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | 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 Summary

    Constructors
    Constructor | Description
    --- | ---
    `Leds()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MIN_INTENSITY

          public static final int MIN_INTENSITY

      Constant for turning off a LED.
      See Also:
        Constant Field Values

    - #### MAX_INTENSITY

          public static final 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.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Leds

          public Leds()

  - ### Method Detail

    - #### getNumberOfLeds

          public static int getNumberOfLeds()

      Returns the available number of LEDs. The range of valid led identifiers is [0..Leds.getNumberOfLeds()-1].
      Returns:
        the number of leds

    - #### setLedIntensity

          public static void setLedIntensity​(int ledId,
                                             int intensity)

      Controls the intensity of the specified LED. If the identifier is invalid (out of range) the method has no effect.
      Parameters:
        `ledId` - the led identifier
        `intensity` - the intensity to set on the led

    - #### getLedIntensity

          public static int getLedIntensity​(int ledId)

      Gets the intensity of the specified LED. If the identifier is invalid (out of range) the method returns 0.
      Parameters:
        `ledId` - the led identifier
      Returns:
        the led intensity

    - #### setLedOn

          public static void setLedOn​(int ledId)

      Turns on the given LED. The effect is identical to `Leds.setLedIntensity(ledId, MAX_INTENSITY)`.
      Parameters:
        `ledId` - the led identifier

    - #### setLedOff

          public static void setLedOff​(int ledId)

      Turns off the given LED. The effect is identical to `Leds.setLedIntensity(ledId, MIN_INTENSITY)`.
      Parameters:
        `ledId` - the led identifier