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.

Revision:
8:3086ea6466d1
Parent:
7:c7daa056b152
--- a/Encoder.cpp	Thu Mar 26 14:21:57 2015 +0000
+++ b/Encoder.cpp	Wed May 20 18:16:22 2015 +0000
@@ -107,6 +107,11 @@
 // State machine. Runs in IRQ. Static.
 static void EncoderTickIRQ()
 {
+#if DEBUG_ENC
+    DebugPin = 0;
+    DebugPin = 1;
+    DebugPin = 0;
+#endif
     // Encoder section
     // If-then-else structure is good because every pin is read max. once.
     if(PinB) {