This simple example shows how to use the XMEGA Pulse Width Modulation (PWM) service to dim LEDs.
This example is made specifically for XMEGA-A1 Xplained. However, any XMEGA board with LEDs connected to PE0-PE6 may be used.
This example sets up 4 PWM channels and outputs them to 4 different LEDs, giving the impression the LEDs are dimmed. All 4 PWM channels are set up with the same frequency, but uses different duty cycles to give different level of dimming. LED3 is set up to light constantly (since the LEDs are active low, this means 0% duty cycle)
This example depends on the following module:
The PWM service API can be found here
This software was written for the GNU GCC. Other compilers may or may not work.
For further information, please visit atmel.com.