mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-26 02:28:29 -04:00
Sub: Add joystick button functions for relays 3 & 4
This commit is contained in:
parent
9085a353bb
commit
5bfd486b4e
@ -358,6 +358,28 @@ void Sub::handle_jsbutton_press(uint8_t button, bool shift, bool held)
|
|||||||
relay.toggle(1);
|
relay.toggle(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case JSButton::button_function_t::k_relay_3_on:
|
||||||
|
relay.on(2);
|
||||||
|
break;
|
||||||
|
case JSButton::button_function_t::k_relay_3_off:
|
||||||
|
relay.off(2);
|
||||||
|
break;
|
||||||
|
case JSButton::button_function_t::k_relay_3_toggle:
|
||||||
|
if (!held) {
|
||||||
|
relay.toggle(2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case JSButton::button_function_t::k_relay_4_on:
|
||||||
|
relay.on(3);
|
||||||
|
break;
|
||||||
|
case JSButton::button_function_t::k_relay_4_off:
|
||||||
|
relay.off(3);
|
||||||
|
break;
|
||||||
|
case JSButton::button_function_t::k_relay_4_toggle:
|
||||||
|
if (!held) {
|
||||||
|
relay.toggle(3);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
// Servo functions
|
// Servo functions
|
||||||
|
Loading…
Reference in New Issue
Block a user