#12 Rotary encoder and interrupts


In this tutorial for beginners you learn how to read a rotary encoder as well working with interrupts.

In this tutorial I use "Serial.println()" in the interrupt function. Because the Serial libary uses interrupts as well, this might cause problems in your project. Therefore don't call Serial functions in interrupt functions.

#12 Rotary encoder and interrupts schakelschema

Components

  • 1× Arduino
  • 1× Breadboard
  • 5× Jumper wire (male-male)
  • 1× Rotary encoder

Tutorial goals

  • Understanding the inner workings of the rotary encoder
  • Reading a rotary encoder
  • Understanding interrupts
  • Applygin interrupts when reading the rotary encoder

Bas van Dijk

About Bas on Tech


My name is Bas van Dijk, entrepreneur, software developer and maker. With Bas on Tech I share video tutorials with a wide variety of tech subjects i.e. Arduino and 3D printing.

Years ago, I bought my first Arduino with one goal: show text on an LCD as soon as possible. It took me many Google searches and digging through various resources, but I finally managed to make it work. I was over the moon by something as simple as an LCD with some text.

With Bas on Tech I want to share my knowledge so others can experience this happiness as well. I've chosen to make short, yet powerful YouTube videos with a the same structure and one subject per video. Each video is accompanied by the source code and a shopping list.