com.qualcomm.robotcore.hardware

## Class LED

- java.lang.Object
- - com.qualcomm.robotcore.hardware.LED

- All Implemented Interfaces:
    HardwareDevice, Light, SwitchableLight

      public class LED
      extends java.lang.Object
      implements HardwareDevice, SwitchableLight

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `HardwareDevice.Manufacturer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LED(DigitalChannelController controller, int physicalPort)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes this device
    `void` | `enable(boolean set)` A method to turn on or turn off the LED
    `void` | `enableLight(boolean enable)` Turns the light on or off.
    `java.lang.String` | `getConnectionInfo()` Get connection information about this device in a human readable format
    `java.lang.String` | `getDeviceName()` Returns a string suitable for display to the user as to the type of device.
    `HardwareDevice.Manufacturer` | `getManufacturer()` Returns an indication of the manufacturer of this device.
    `int` | `getVersion()` Version
    `boolean` | `isLightOn()` Answers whether the light is on or off
    `void` | `resetDeviceConfigurationForOpMode()` Resets the device's configuration to that which is expected at the beginning of an OpMode.

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

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

- - ### Constructor Detail

    - #### LED

          public LED(DigitalChannelController controller,
                     int physicalPort)

      Constructor
      Parameters:
        `controller` - Digital Channel Controller this LED is attached to
        `physicalPort` - the physical port it's plugged into.

  - ### Method Detail

    - #### enable

          public void enable(boolean set)

      A method to turn on or turn off the LED
      Parameters:
        `set` - - true turns it on, false turns it off.

    - #### isLightOn

          public boolean isLightOn()

      Description copied from interface: `Light`
      Answers whether the light is on or off
      Specified by:
        `isLightOn` in interface `Light`
      Returns:
        whether the light is on or off

    - #### enableLight

          public void enableLight(boolean enable)

      Description copied from interface: `SwitchableLight`
      Turns the light on or off.
      Specified by:
        `enableLight` in interface `SwitchableLight`
      Parameters:
        `enable` - if true, the light turns on; otherwise the light turns off

    - #### getManufacturer

          public HardwareDevice.Manufacturer getManufacturer()

      Description copied from interface: `HardwareDevice`
      Returns an indication of the manufacturer of this device.
      Specified by:
        `getManufacturer` in interface `HardwareDevice`
      Returns:
        the device's manufacturer

    - #### getDeviceName

          public java.lang.String getDeviceName()

      Description copied from interface: `HardwareDevice`
      Returns a string suitable for display to the user as to the type of device. Note that this is a device-type-specific name; it has nothing to do with the name by which a user might have configured the device in a robot configuration.
      Specified by:
        `getDeviceName` in interface `HardwareDevice`
      Returns:
        device manufacturer and name

    - #### getConnectionInfo

          public java.lang.String getConnectionInfo()

      Description copied from interface: `HardwareDevice`
      Get connection information about this device in a human readable format
      Specified by:
        `getConnectionInfo` in interface `HardwareDevice`
      Returns:
        connection info

    - #### getVersion

          public int getVersion()

      Description copied from interface: `HardwareDevice`
      Version
      Specified by:
        `getVersion` in interface `HardwareDevice`
      Returns:
        get the version of this device

    - #### resetDeviceConfigurationForOpMode

          public void resetDeviceConfigurationForOpMode()

      Description copied from interface: `HardwareDevice`
      Resets the device's configuration to that which is expected at the beginning of an OpMode. For example, motors will reset the their direction to 'forward'.
      Specified by:
        `resetDeviceConfigurationForOpMode` in interface `HardwareDevice`

    - #### close

          public void close()

      Description copied from interface: `HardwareDevice`
      Closes this device
      Specified by:
        `close` in interface `HardwareDevice`