# Using joystick axes as a slider in Cockpit

**URL:** <https://discuss.bluerobotics.com/t/using-joystick-axes-as-a-slider-in-cockpit/20768>\
**Category:** Cockpit\
**Created:** [June 26, 2025, 3:39pm UTC](https://discuss.bluerobotics.com/t/using-joystick-axes-as-a-slider-in-cockpit/20768 "2025-06-26T15:39:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbp64](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jbp64](https://discuss.bluerobotics.com/u/jbp64)\
**Post date:** [June 26, 2025, 3:39pm UTC](https://discuss.bluerobotics.com/t/using-joystick-axes-as-a-slider-in-cockpit/20768/1 "2025-06-26T15:39:01Z")

</div>

Hi all,

I am working on a custom submarine using the Navigator shield. I would like to implement a PWM output for a pin based on the values of the axes in Cockpit. For instance, when axis 0 is 1.00, I want the PWM output to be 1900 for servo 1. Based on the discussion [here](https://discuss.bluerobotics.com/t/cockpit-slider-to-control-light-brightness/20722), I believe that the general method would be to create a compound variable that reads the value of axis 0 and then inputs it into parameter 2 for the MAVLINK command MAV\_CMD\_DO\_SET\_SERVO. Is it possible to do this?

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [June 26, 2025, 4:24pm UTC](https://discuss.bluerobotics.com/t/using-joystick-axes-as-a-slider-in-cockpit/20768/2 "2025-06-26T16:24:56Z")

</div>

Hi @jbp64, welcome to the forum 🙂

Unfortunately joystick axes are [not yet integrated with Cockpit’s data lake](https://github.com/bluerobotics/cockpit/issues/1658), so can’t be used directly as values for Actions.

That said, depending on your vehicle frame it may be possible to set a servo value based directly on an axis value by configuring the relevant [`SERVOn_FUNCTION`](https://ardupilot.org/sub/docs/parameters.html#servo1-function-servo-output-function) parameter to the corresponding [input channel](https://ardupilot.org/sub/docs/sub-hardware.html#mavlink-overrides). There is also a potential workaround where an unused motion axis can be sent control signals from the control station software, which are then read back in to Cockpit through MAVLink, at which point the values could be read from the data lake for use in a custom Action.
