<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On 11 Aug 2015, at 03:18, john slee <<a href="mailto:indigoid@oldcorollas.org">indigoid@oldcorollas.org</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 August 2015 at 21:45, Rick Jansen <span dir="ltr"><<a href="mailto:rick.jansen@xs4all.nl" target="_blank">rick.jansen@xs4all.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It works quite well, but at the same time I wonder how other
machines work, that track 8 or 16 rotary encoders.. An Arduino
Mega has many more interrupt pins than the measly Arduino Uno, but
still. Is there a clever trick to track many rotary encoders that
I am missing?</blockquote></div><br>Note that while the ATmega328 has two interrupt pins, it ALSO has a pin-change interrupt (PCINT) mechanism wherein you set a mask for the pins you want to monitor, and then it generates a PCINT interrupt when any of those pins change.</div><div class="gmail_extra"><br></div><div class="gmail_extra">So you could add all your encoder GPIO pins to the mask and then whenever it fires, read all of them.</div><div class="gmail_extra"><br></div><div class="gmail_extra">If you assign their GPIO pins sensibly you can then read 8 pins (one byte/four encoders) in one instruction.</div><div class="gmail_extra"><br></div><div class="gmail_extra">John</div></div>
</div></blockquote><br><div>Great idea! I had forgotten this is possible! It makes it easier to read at least a few encoders. Thanks!</div><div><br></div><div>rick</div></body></html>