58 lines
1.7 KiB
C++
58 lines
1.7 KiB
C++
#include <Joystick.h>
|
|
|
|
Joystick joystick(false);
|
|
|
|
void setup() {
|
|
// for (uint8_t i = 0; i < 14; i++) {
|
|
// joystick.AddButton(i, BUTTON_PASSTHRU);
|
|
// }
|
|
// joystick.AddButton(A0, BUTTON_PASSTHRU);
|
|
// joystick.AddButton(A1, BUTTON_PASSTHRU);
|
|
// joystick.AddButton(A2, BUTTON_PASSTHRU);
|
|
// joystick.AddButton(A3, BUTTON_PASSTHRU);
|
|
// joystick.AddButton(A4, BUTTON_PASSTHRU);
|
|
// joystick.AddButton(A5, BUTTON_PASSTHRU);
|
|
|
|
// // Power switches
|
|
joystick.AddButton(2, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
|
joystick.AddButton(3, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
|
joystick.AddButton(4, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
|
joystick.AddButton(5, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
|
|
|
// // HUD modes
|
|
joystick.AddButton(8, BUTTON_PASSTHRU);
|
|
joystick.AddButton(7, BUTTON_PASSTHRU);
|
|
joystick.AddButton(6, BUTTON_PASSTHRU);
|
|
|
|
// // Encoders
|
|
// // FIXME: these seem to be wired wrong.
|
|
// // joystick.AddEncoder(10, 11, ENCODER_PULSED_SPLIT);
|
|
// // joystick.AddEncoder(12, 13, ENCODER_PULSED_SPLIT);
|
|
|
|
// // Mining Modules
|
|
joystick.AddButton(9, BUTTON_PASSTHRU);
|
|
joystick.AddButton(10, BUTTON_PASSTHRU);
|
|
joystick.AddButton(11, BUTTON_PASSTHRU);
|
|
|
|
// // Flight Modes
|
|
joystick.AddButton(A1, BUTTON_PASSTHRU);
|
|
joystick.AddButton(A2, BUTTON_PASSTHRU);
|
|
joystick.AddButton(A3, BUTTON_PASSTHRU);
|
|
joystick.AddButton(A4, BUTTON_PASSTHRU);
|
|
|
|
// // Doors & Lights
|
|
// // TODO: Need multiplexer setup
|
|
joystick.AddButton(12, BUTTON_PULSED_DOUBLE_ACTION);
|
|
joystick.AddButton(A0, BUTTON_PULSED_DOUBLE_ACTION);
|
|
|
|
// // Emergency Panel
|
|
// // TODO: Need multiplexer setup
|
|
joystick.AddButton(A5, BUTTON_PASSTHRU);
|
|
|
|
joystick.Init();
|
|
}
|
|
|
|
void loop() {
|
|
joystick.Update();
|
|
}
|