The LED control allows an LED (light emitting diode) to be connected to the HID Device.  An LED appears as a HID output with an On/Off state.  An LED can be connected to any I/O port.

An LED, with a current limiting resistor, can be wired directly to one of the microcontrollers IO pins.  They can be connecting in two different ways: with the microcontroller sourcing current (source) or sinking it (sink).  The two schematics show the differences...

The first circuit shows the microcontroller pin, PD0, sourcing the current.  The microcontroller pin switches between 0 volts (ground), and VCC (power supply voltage).  To light the LED, the microcontroller provides VCC, and the current flow from the pin, through the LED and resistor, to ground.

In the second circuit, the LED will be lit when the microcontroller pin is set to 0 volts.  The current run from the power supply, VCC, through the LED and resistor, back into microcontroller pin. 

The only difference in the two methods is that sinking may turn on the LED momentarily when the microcontroller is being reset.  Otherwise, as long as the microcontroller is told the method, it can make sure On means On.

For more general information on LEDs, see the section on LEDs.



Components can be given an optional name.  This is seen in the Test tab. Not all applications support the name.  Hidcomp/hidconfig supports names.


The UsagePage and Usage of the LED. See Usages for more information.


Defines whether the microcontroller sources or sinks the LED current. This is described above.


Defines the amount of electrical current used by the LED in mA. This is used to estimate the USB power draw.  See the section on Power for more information.

See Also

Bicolour LED, Tri-colour LED, RGB LED, LEDs