# HELP! Rotary Encoder step to servo

**URL:** <https://forum.xod.io/t/help-rotary-encoder-step-to-servo/1107>\
**Category:** Uncategorized\
**Created:** [September 7, 2018, 1:10pm UTC](https://forum.xod.io/t/help-rotary-encoder-step-to-servo/1107 "2018-09-07T13:10:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![madsteex](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@madsteex](https://forum.xod.io/u/madsteex)\
**Post date:** [September 7, 2018, 1:10pm UTC](https://forum.xod.io/t/help-rotary-encoder-step-to-servo/1107/1 "2018-09-07T13:10:07Z")

</div>

Hi! I want to connect a cheap rotary encoder (20 pulse in 360°) to a servo motor to use as follow focus in video shooting.  
Basically since there is only 20 pulse in my rotary encoder I want to manage the rotation of the servo as precise as possible. So for example with 1 pulse I would that the servo will turn of 1 degree or less. Is possible? I’m not very able with XOD code I’m starting with this kind of programming world, so if some one can help me with a screenshot of a built work will be very appreciated

---

<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:** [September 10, 2018, 7:21am UTC](https://forum.xod.io/t/help-rotary-encoder-step-to-servo/1107/2 "2018-09-10T07:21:37Z")

</div>

Hello! There’s no encoder node built-in. However, it was [discussed before](https://forum.xod.io/t/some-help-needed-on-the-logic-of-encoder-direction-detection/428). You can try and check whether it works for your encoder.

Mixing the encoder node with the `servo` node possibly with `count` along the path should do the trick.

---

<div class="post-metadata">

**Author:** ![madsteex](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@madsteex](https://forum.xod.io/u/madsteex)\
**Post date:** [September 10, 2018, 9:50pm UTC](https://forum.xod.io/t/help-rotary-encoder-step-to-servo/1107/3 "2018-09-10T21:50:56Z")

</div>

could you provide me the program or the scheme? I’m new on XOD

---

<div class="post-metadata">

**Author:** ![madsteex](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@madsteex](https://forum.xod.io/u/madsteex)\
**Post date:** [September 12, 2018, 5:45pm UTC](https://forum.xod.io/t/help-rotary-encoder-step-to-servo/1107/4 "2018-09-12T17:45:17Z")

</div>

![24](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/061538b32212b45c2fe5f65414c395e2002dd81c.png)  
the OPC should give me +1 or -1 step, but connected to the servo does not work…how I have to modify ?
