#include "rotary_encoder_driver.h" #include RotaryEncoderDriver* driver = nullptr; RotaryEncoderDriver::RotaryEncoderDriver() : cycle(0) , count(0) , prev_count(0) , speed_ready(false) , hist_idx(0) , eA(2) , eB(5) , delta(0) { for (uint8_t i = 0; i < HIST_LEN; i++) { history[i] = 0; } } void RotaryEncoderDriver::begin() { driver = this; //led.init(); eA.init(); eB.init(); EICRA |= (1<update(); } ISR(TIMER1_COMPA_vect) { driver->update_delta(); }