Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Rotary Encoder with Timer Input Capture – STM32 Tutorial #18

3.4K views on YouTube

In this video we will decode the signals from a rotary encoder using input capture from two timer channels.

As usual please like and subscribe and questions/comments really help me improving the quality of the channel.

Described on our wiki here: https://stm32world.com/wiki/STM32_Rotary_Encoder
Project Files: https://github.com/STM32World/stm32fun

00:00 Intro/Recap and an apology
01:39 Introduction to rotary encoders
06:18 Setting up a project
07:03 Configuring the timer in encoder mode
10:37 Adding interrupt handling on changes
13:12 Handling button press
15:39 Speculating an alternative approach using an interrupt driven state machine