This is just a small demo code that shows the usage of a rotary encoder (with indexing positions) on an Atmel microprocessor.
It includes header & source file that you could probably use in your own project. Although it works fine consider it experimental.