Skip to content

Instantly share code, notes, and snippets.

View proddy's full-sized avatar

Proddy proddy

View GitHub Profile
@proddy
proddy / RotaryEncoderRGB.cpp
Created June 16, 2020 13:09
rotary encoder RGB on ESP32
// based on https://github.com/igorantolic/ai-esp32-rotary-encoder
// and fixed using http://blog.templaro.com/reading-a-rotary-encoder-demo-code-for-atmega328/
#include "AiEsp32RotaryEncoder.h"
void IRAM_ATTR AiEsp32RotaryEncoder::readEncoder_ISR() {
portENTER_CRITICAL_ISR(&(this->mux));
if (this->isEnabled) {
this->old_AB <<= 2; // remember previous state