# Control lights and tilt through pushbuttons in Cockpit

**URL:** <https://discuss.bluerobotics.com/t/control-lights-and-tilt-through-pushbuttons-in-cockpit/22608>\
**Category:** Cockpit\
**Created:** [March 11, 2026, 8:57pm UTC](https://discuss.bluerobotics.com/t/control-lights-and-tilt-through-pushbuttons-in-cockpit/22608 "2026-03-11T20:57:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarburg](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amarburg](https://discuss.bluerobotics.com/u/amarburg)\
**Post date:** [March 11, 2026, 8:57pm UTC](https://discuss.bluerobotics.com/t/control-lights-and-tilt-through-pushbuttons-in-cockpit/22608/1 "2026-03-11T20:57:58Z")

</div>

We have an application where we want to run Cockpit **without a joystick** and instead control the lights and camera tilt through pushbuttons within Cockpit.

So far, I have tried adding MAVLink actions which generate ManualControl messages for the associated button presses. I can then associate those with input widgets in the interface, and it “works” with some undesirable behavior. Tilt up/down goes all the way to the extents with a single press, while the lights can only be incremented by one “step” up or down, then does not increment any further.

I’m mostly convinced this is consistent with the button never being “unpressed” – the ManualControl messages stop when you release the widget, but a ManualControl message with “no button pressed” is never sent.

Is there a smarter way to do this? Reading around a bit, maybe I can get more sophisticated behavior with a Javascript action?

---

<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:** [March 12, 2026, 9:18pm UTC](https://discuss.bluerobotics.com/t/control-lights-and-tilt-through-pushbuttons-in-cockpit/22608/2 "2026-03-12T21:18:19Z")

</div>

Hi @amarburg,

> [@amarburg](#):
>
> I’m mostly convinced this is consistent with the button never being “unpressed” – the ManualControl messages stop when you release the widget, but a ManualControl message with “no button pressed” is never sent.

Indeed. This approach would be more effective if you added a “stop” button that sends a [`MANUAL_CONTROL`](https://mavlink.io/en/messages/common.html#MANUAL_CONTROL) message with all the buttons un-pressed.

That said, MAVLink is not confined to joystick-related messages (in fact, we’re largely trying to move away from dependence on the autopilot interpreting button inputs), and there are almost certainly better ways of achieving what you’re after 🙂

> [@amarburg](#):
>
> control the lights and camera tilt … within Cockpit.

I’d recommend following [these instructions](https://discuss.bluerobotics.com/t/cockpit-slider-to-control-light-brightness/20722/2) for lights control setup.

If your camera tilt servo has its output assigned to the `MountTilt` function, camera tilt control should be possible in a similar way using [`MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW`](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW) messages, though it may also be required to specify the mode ([like we do in BlueOS](https://github.com/bluerobotics/BlueOS/blob/4394c7f97084dc8e57a69650bce73dd1830f77b3/core/frontend/src/components/vehiclesetup/configuration/camera.vue#L336-L343)).

> **EDIT** : We have confirmed that it works to use [`MAV_CMD_DO_MOUNT_CONTROL`](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_MOUNT_CONTROL), with `param1` set to the angle you want (e.g. using a data-lake variable), and `param7` set to `RC_TARGETING (3)`

---

<div class="post-metadata">

**Author:** ![amarburg](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amarburg](https://discuss.bluerobotics.com/u/amarburg)\
**Post date:** [March 12, 2026, 9:55pm UTC](https://discuss.bluerobotics.com/t/control-lights-and-tilt-through-pushbuttons-in-cockpit/22608/3 "2026-03-12T21:55:54Z")

</div>

Awesome! I will try that out, and thanks

---

<div class="post-metadata">

**Author:** ![amarburg](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@amarburg](https://discuss.bluerobotics.com/u/amarburg)\
**Post date:** [March 21, 2026, 2:07pm UTC](https://discuss.bluerobotics.com/t/control-lights-and-tilt-through-pushbuttons-in-cockpit/22608/4 "2026-03-21T14:07:20Z")

</div>

@EliotBR Thanks for all the help. I was able to get this working yesterday. Before I saw your update, I set up the pitch motor to be controlled with `MAV_CMD_DO_SET_SERVO`, I can confirm this works as well.

A couple of brief notes for the record:

1. I found I needed to use the full path for variables (e.g. `user/compound/light1pwm` rather than `light1pwm`)
2. For mount control, I needed to set `param7` to `MAV_MOUNT_MODE_MAVLINK_TARGETING` I’m sure this is a minor difference in backend Ardupilot configuration.
