Introduction
This application note describes how to control the brightness of LED (USER LED on the ATmega328PB Xplained Mini kit) by using the Peripheral Touch Controller (PTC) module of the Atmel® AVR® ATmega328PB device. The PTC module is used for position sensing of the capacitive touch slider present on the Xplained Mini kit. The slider position is used to vary the PWM duty cycle hence control the brightness of the USER LED. The source code is available for download along with this application note. An ATmega328PB Xplained Mini kit is used to demonstrate the application.