# Servo 360 degree, direction with two buttons

**URL:** <https://forum.xod.io/t/servo-360-degree-direction-with-two-buttons/5856>\
**Category:** Uncategorized\
**Created:** [February 9, 2022, 4:28pm UTC](https://forum.xod.io/t/servo-360-degree-direction-with-two-buttons/5856 "2022-02-09T16:28:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexluther35](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@lexluther35](https://forum.xod.io/u/lexluther35)\
**Post date:** [February 9, 2022, 4:28pm UTC](https://forum.xod.io/t/servo-360-degree-direction-with-two-buttons/5856/1 "2022-02-09T16:28:04Z")

</div>

Hi! I would like to run directions with push buttons. It works with SELECT nod, but it does not stop, if no button is preset. How to stop the servo?  
Thank you!  
Alex

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/f/f8139a6cb22cc0463992c86dc2b7be202226746b.jpeg)

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [February 10, 2022, 3:58am UTC](https://forum.xod.io/t/servo-360-degree-direction-with-two-buttons/5856/2 "2022-02-10T03:58:31Z")

</div>

Your current code sets a value for the servo to aim for (with 360 degree servo, this is basically a speed to move), and you always keep the servo turned on.

There are two options to stop the servo. Either disable the servo (servo-ACT false) or select the stop “speed”. The two options have different results for normal servo (free-wheel vs hold center position), but I’m guessing the end result of either solution is the same for 360 degree servos (free-wheel). The advantage of disabling the servo to stop is you don’t have to determine what the stop value is (it should be 0.50, but might be slightly different and can change if servo is replaced).

Disable servo:  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/f/f0f8db25b8d745f89912ec95077bde43fe28774d.png)  
The servo is only enabled if (at least) one button is pressed

Set stop speed:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/92a9e37dbbcd96ff27a333a360fbf4170bbd5b59.png)  
The puls… nodes are pulse-on-false (i.e. when button is released)

---

<div class="post-metadata">

**Author:** ![lexluther35](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@lexluther35](https://forum.xod.io/u/lexluther35)\
**Post date:** [February 10, 2022, 4:56am UTC](https://forum.xod.io/t/servo-360-degree-direction-with-two-buttons/5856/3 "2022-02-10T04:56:24Z")

</div>

It works. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [March 12, 2022, 4:57am UTC](https://forum.xod.io/t/servo-360-degree-direction-with-two-buttons/5856/4 "2022-03-12T04:57:03Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
