Skip to content

Commit

Permalink
Sub: Add joystick button functions for relays 3 & 4
Browse files Browse the repository at this point in the history
  • Loading branch information
dheideman authored and jaxxzer committed Oct 27, 2017
1 parent 2fab8e9 commit 99f63d6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ArduSub/joystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,28 @@ void Sub::handle_jsbutton_press(uint8_t button, bool shift, bool held)
relay.toggle(1);
}
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
Expand Down

0 comments on commit 99f63d6

Please sign in to comment.