Introduction
This application is the default AT32UC3L-EK demonstration application that interfaces with QTouchStudio and controls the LEDs with the touch sensors. It is using the Atmel QTouch Libraries for the AVR UC3 L0 series.
Main files:
- uc3l-ek-touch-demo.c: main file with
- setup the clocks,
- setup a timer and its interrupt handler,
- setup the QTouch lib,
- setup the QDebug interface,
- setup and calibrate the QTouch lib sensors,
- setup the demo
- main loop.
- demo.c: demo state-machine.
- touch_api_at32uc3l.h: the AT32UC3L QTouch Library API interface for QMatrix, QTouch and Autonomous Touch method using the Capacitive Touch (CAT) module.
- touch_config_at32uc3l.h: the AT32UC3L Touch Library pin, register and sensors configuration options for QMatrix, Autonomous QTouch and QTouch Group A/B method acquisition using the Capacitive Touch (CAT) module. The configuration is tailored for the AT32UC3L-EK.
- QDebugSettings.h: QTouch Debug Interface configuration for AT32UC3L-EK
Device Info
This application is targeted for the AT32UC3L-EK board only.
Description of the example
- Prologue of the demo: all 4 LEDs blink 3 times simultaneously with PWM fading effect.
- The wheel engages the GPIO PWM to create a 256-level "bar" on the 4 LEDs. Rotating clockwise will gradually light up the bottom led in 64 steps, then the LED above it will begin to glow, and so on until all 4 LEDs are fully lit. Turning another clockwise round will have no effect. Turning anticlockwise one round will make it gradually decrease the 256-level counter, thus causing the bar to fade downwards until you hit 0.
- Pushing Play/pause starts an automatic running lights sequence on all 4 LEDs. The PWM is used to create fading effect. Use the Up and Down arrows to increase or decrease the speed of the automatic running lights sequence.
- The Up and Down arrows are used to turn the 4 LEDs fully on (quick push on up), off (quick push on down), and gradually fading on and off (keep up or down pushed for 0.5 seconds, use 2.5 seconds to go from rail to rail, like a dimming light switch). While the automatic running lights sequence is active, the Up and Down arrows are used to increase or decrease the speed of that sequence.
- The Right arrow engages the GPIO PWM to create a 256-level "bar" on the 4 LEDs. Keep the right arrow pushed to gradually light up the bottom LED in 64 steps, then the LED above it will begin to glow, and so on until all 4 LEDs are fully lit. Keep the Left arrow pushed to gradually decrease the 256-level counter, thus causing the bar to fade downwards until you hit 0.
- Interface with AVR QTouchStudio: when the USB mode is in QDebug mode (USB HID class that communicates with QTouch Studio), all touch events are reported to QTouch Studio. Open QTouchStudio: a drawing of the UC3L-EK should appear. Click on the "start reading" button. All touch events on the board appear on the UC3L-EK drawing on QTouch Studio (a green color is a match).
- Note
- The AT32UC3L-EK supports two USB modes: the CDC Virtual Com Port and the QDebug mode. Change of the USB mode is done upon power-up of the board by pressing the USB mode button.
Compilation Info
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
Contact Information
For further information, visit Microchip.