[TUT] Interfacing 2 bit rotary encoder switches

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a discussion of well behaved (YMMV), interrupt driven, rotary encoder switch interfacing.

Attachment(s): 

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

Last Edited: Fri. Jun 12, 2009 - 09:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

your word doc describes exactly what I need to do! Very cool. Do you have any sample code?

Thank you
Dancy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unfortunately I don't have any code, although it's easy from the description to write. You might start a new thread asking for some if you need it. I'm sure many people have some they'd be glad to share.

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi there,

I have written some code which works fine for me, but:
a) it must be called from timer interrupt
b) requires one variable to remember the last state
c) regonises only full steps (which I found better for 'device behaviour').

Some time ago I tried using two external interrupts, but with no success.

From the .doc file:

Quote:

The jitter settles out by itself without the debouncing, however, and for many applications would not be a problem.

I use encoder to change many values in my program, that are displayed on LCD. And I just wonder if the jitter won't be visible when user changes value? If you could propose some debouncing function (or description) I'm ready to test it;) It would be nice to have external interrupts driven encoder routines, than timer polled ones.

Anyway, if you're interested in my code (and if it applies here), please let me to know.

Best regards,
A. Telszewski