This application note provides a short description of how to use the touch sensing key to change an LED blinking speed.
This document explains how to utilize the touch sensing feature of the STM8S-DISCOVERY evaluation board to control an LED (LD1) blinking speed. The application uses the TS1 key; pressing it increases the blink rate, and the third press turns the LED off.
The software implementation relies on two firmware libraries: the standard STM8S library for general functions like GPIOs and clocking, and a specific touch sensing library to manage the RC acquisition principle via timer TIM3. Timer TIM4 acts as the time-base generator that is reprogrammed upon detecting a touch event.
The application uses the STM8S105C6T6 microcontroller.
The LED is switched off after the third time the TS1 key is pressed.
The application uses timer TIM4 as a time-base generator to control the blinking speed.