rotary encoder logic updated to use abstraction layer