Fading RGB LED PWM
The circuit is very simple. The RGB LED is hooked up to the PWM outputs on PORTB1 , PORTB2 and PORTB3 of the ATMega8. There is also a resistor between the LED and the ATM8 to limit the current to 20mA. There is also a link to the datasheet of the RGB LED that is used in this project. The code for the fading LED is written in assembler with the AVR Studio 4. In this example the LEDs will fade in and out one by one. The PWM timers of the ATMega8 are used to let the LED’s fade in and out.
   Fading RGB LED PWM
For more detail Fading RGB LED PWM website
www.avrprojects.net