tinkerspy / Automaton

Reactive State Machine Framework for Arduino
https://github.com/tinkerspy/Automaton/wiki
MIT License
374 stars 63 forks source link

Encoder switch debounce #51

Open jfitter opened 7 years ago

jfitter commented 7 years ago

The encoder machine needs to implement a debounce. When used with mechanical rotary encoders an arbitrary number of events are fired when the encoder is rotated. In my hardware implementation I have a high quality Bourns encoder and capacitive filters on the switches, but still receive 2 to 6 events for each incremental encoder position. In the previous version of the software (before using Automaton) the encoder triggers interrupts and a simple software debounce is implemented. This works very well. The current implementation of Atm_encoder cannot be made to work with this encoder.

DrDiodac commented 6 years ago

I have similar problems like jfitter. But when I run sketch just with state encoder machine and add some of leds all work very well. But when I try any implementation to other things coming problem, machine working unstable, reading few positions at once. I have quality encoder, hardware debounce and keep attention to detail when I write code. I working on Teensy 3.2.

knifesk commented 2 years ago

+1 here. it fires once up and down at least no matter the direction