Thursday, August 11, 2011

Not all rotary encoders are created equal...

I had a hell of a time getting the (F)Light Suit remote control to work with the Modern Device LCD117 backpack and inexpensive BI EN11-HSM1AF15 rotary encoders. It turned out that I was having two issues:
  1. The LCD117 was getting its updating commands too quickly, so chose to reset instead of display, and
  2. the rotary encoders make contact so quickly when stepping up or down, my debounced code for bigger rotary encoders with more even click timing wasn't working.
Preventing the LCD117 from updating too quickly solved the first problem, and redoing the rotary encoder code from scratch solved the second problem. I'll post code later when the project is complete, but I based it on Max Wolf's very simple first example from the Arduino Playground rotary encoder page. The interrupt-based examples are too cryptic and (I think) unnecessary in a sketch that loops at a few KHz, which all of my sketches run at.

No comments:

Post a Comment