Library for manual Encoders as used in user interfaces. Very simple, reduced and rock solid encoder library. Counts full pulses only. Inherent debouncing through state machine. Running on a regular timer IRQ. No IRQ jamming through bouncing. Immune to false edges giving unwanted counts when moving partial steps. Not depending on PinDetect or anything else. May be enhanced by adding acceleration and push button debouncing in the future.

Library for manual Encoders as used in user interfaces. Very simple, reduced and rock solid. Counts full pulses/steps only. Inherent debouncing through state machine. No time dependency for debouncing. Very tight code running in a regular timer IRQ. No IRQ jamming through bouncing edges. Immune to false edges giving unwanted counts when moving partial steps back and forth. Not depending on PinDetect or any other debouncing library. May be enhanced in the near future by adding acceleration and push button debouncing.

Committer:
eduardoG26
Date:
Mon Nov 24 17:06:08 2014 +0000
Revision:
0:fc87dcec05fd
First Revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
eduardoG26 0:fc87dcec05fd 1 #ifndef UI_ENCODER_H_
eduardoG26 0:fc87dcec05fd 2 #define UI_ENCODER_H_
eduardoG26 0:fc87dcec05fd 3
eduardoG26 0:fc87dcec05fd 4 #include "mbed.h"
eduardoG26 0:fc87dcec05fd 5
eduardoG26 0:fc87dcec05fd 6 #define ENCODER_PIN_A D6
eduardoG26 0:fc87dcec05fd 7 #define ENCODER_PIN_B D7
eduardoG26 0:fc87dcec05fd 8
eduardoG26 0:fc87dcec05fd 9 void EncoderStart ();
eduardoG26 0:fc87dcec05fd 10 uint16_t EncoderGet(void);
eduardoG26 0:fc87dcec05fd 11
eduardoG26 0:fc87dcec05fd 12 #endif // UI_ENCODER_H_
eduardoG26 0:fc87dcec05fd 13
eduardoG26 0:fc87dcec05fd 14 // End of file