Skip to content

Instantly share code, notes, and snippets.

@aykevl
aykevl / rotary.cpp
Created October 23, 2022 15:14
Rotary encoder example
#include <Arduino.h>
// Source:
// https://web.archive.org/web/20160815200234/https://www.circuitsathome.com/mcu/programming/reading-rotary-encoder-on-arduino
const uint8_t ROTARY_PIN_A = 1; // TX
const uint8_t ROTARY_PIN_B = 3; // RX
int8_t rotaryValue = 0;