# Simple rotary encoder lib

**URL:** <https://forum.xod.io/t/simple-rotary-encoder-lib/1202>\
**Category:** Look What I’ve Done\
**Created:** [October 8, 2018, 4:00pm UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202 "2018-10-08T16:00:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [October 8, 2018, 4:00pm UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202/1 "2018-10-08T16:00:36Z")

</div>

Hello, folks!

Some people asked for rotary encoder support in XOD. Although there were a [few](https://forum.xod.io/t/help-rotary-encoder-step-to-servo/1107) [related](https://forum.xod.io/t/rotary-encoder-solution/866) [threads](https://forum.xod.io/t/some-help-needed-on-the-logic-of-encoder-direction-detection/428), it looks like there is no final solution that will cover the most basic cases.

So, I’ve published a simple library [`nkrkv/encoder`](https://xod.io/libs/nkrkv/encoder/) to read the quadrature encoders (EC11, many hobby wheel encoders). Hope you will find it useful.

---

<div class="post-metadata">

**Author:** ![mpf102](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/mpf102/32/492_2.png) [@mpf102](https://forum.xod.io/u/mpf102)\
**Post date:** [October 16, 2018, 11:06pm UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202/2 "2018-10-16T23:06:26Z")

</div>

Very useful!!  
How can I get that library? Or any other library, indeed. I cannot download any library, all links in [https://xod.io/libs/](https://xod.io/libs/) seems to be a recursive loop and goes nowhere.  
Another question: what is the last node, linked to the “count” node’s output?

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [October 16, 2018, 11:13pm UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202/3 "2018-10-16T23:13:57Z")

</div>

hi @mpf102 ,

 ![load-lib](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/18eda6e0ca502cdc1b77332f6005d6c6bc72b4c1.png)

br

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [October 17, 2018, 8:46am UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202/4 "2018-10-17T08:46:57Z")

</div>

> [@mpf102](#):
>
> what is the last node, linked to the “count” node’s output?

It is `xod/core/watch`. If you upload with “Debug after upload” the watch nodes become interactive.

---

<div class="post-metadata">

**Author:** ![mpf102](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/mpf102/32/492_2.png) [@mpf102](https://forum.xod.io/u/mpf102)\
**Post date:** [October 18, 2018, 12:42am UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202/5 "2018-10-18T00:42:31Z")

</div>

Thank you!! @cesars & @nkrkv

---

<div class="post-metadata">

**Author:** ![kopnovns](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/kopnovns/32/1454_2.png) [@kopnovns](https://forum.xod.io/u/kopnovns)\
**Post date:** [August 6, 2019, 8:16pm UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202/6 "2019-08-06T20:16:15Z")

</div>

Guys, need help. I have problem with encoder and lcd display. Encoder is not working when display has connected. What do you think?

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [August 13, 2019, 8:34am UTC](https://forum.xod.io/t/simple-rotary-encoder-lib/1202/7 "2019-08-13T08:34:41Z")

</div>

The encoder works by continuously polling the state of its inputs (in software). And if you’re using I2C LCD which is `UPD`’ated continuously, it takes precious time for redrawing the text again and again.

Try to pulse on `UPD` of text LCD only when the update is indeed required. You can use the `xod/core/pulse-on-change` node for this, or get a necessary pulse from an upstream node. That depends on your patch.
