You can adjust the LED (light-emitting diode) or glow lamp brightness with the help of Pulse Width Modulation (PWM). LED dimming is achieved by turning the LED "ON" and "OFF" at high frequency, so fast that the human eye cannot see the strobe effect. The LED current is proportional to the PWM duty cycle. PWM duty cycle is a percentage measurement of the time when the LED is "ON". If the LED is "ON" for 4 ms and "OFF" for 6 ms, the PWM duty cycle is 40%. The longer the "ON" periods are relative to the "OFF" periods, the brighter the LED appears to the observer.
The LED current is proportional to the duty cycle, but its brightness characteristics depend on the current nonliteraly.
On the following figures you can see circuit examples for LED and DC lamp dimming controller:
You can use PWM interface of DLN-series PC-I2C/SPI/GPIO Adapters to control DC lamps and LEDs dimming from a PC. The output current of USB-IO adapter pins can reach 25mA and it is possible to adjust the LED brightness directly (total current of all outputs should not exceed 260mA).
The next figure illustrates the circuit for direct LED dimmer: