diff --git a/flight-panel-2021-11/Flight Panel 2021-11 Schematic.pdf b/flight-panel-2021-11/Flight Panel 2021-11 Schematic.pdf index 5911415..8787247 100644 Binary files a/flight-panel-2021-11/Flight Panel 2021-11 Schematic.pdf and b/flight-panel-2021-11/Flight Panel 2021-11 Schematic.pdf differ diff --git a/flight-panel-2021-11/Flight Panel 2021-11.brd b/flight-panel-2021-11/Flight Panel 2021-11.brd index 17ba235..f17ecf3 100644 --- a/flight-panel-2021-11/Flight Panel 2021-11.brd +++ b/flight-panel-2021-11/Flight Panel 2021-11.brd @@ -849,47 +849,47 @@ design rules under a new name. - + - - - + + + - + - + - + - + - + - - - + + + - + - + - + @@ -901,55 +901,55 @@ design rules under a new name. - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -957,15 +957,15 @@ design rules under a new name. - + - + - + @@ -974,16 +974,12 @@ design rules under a new name. - - - - - + @@ -994,19 +990,19 @@ design rules under a new name. - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -1021,50 +1017,50 @@ design rules under a new name. - + - - - - - - - + + + + + + + - - - - - - - + + + + + - - + + + + - - - - + + + + - + @@ -1074,7 +1070,7 @@ design rules under a new name. - + @@ -1084,15 +1080,16 @@ design rules under a new name. - - + - + + + - + @@ -1101,7 +1098,7 @@ design rules under a new name. - + @@ -1110,7 +1107,7 @@ design rules under a new name. - + @@ -1121,13 +1118,11 @@ design rules under a new name. - + - - - - + + @@ -1148,7 +1143,7 @@ design rules under a new name. - + @@ -1158,7 +1153,7 @@ design rules under a new name. - + @@ -1170,7 +1165,7 @@ design rules under a new name. - + @@ -1180,7 +1175,7 @@ design rules under a new name. - + @@ -1192,21 +1187,21 @@ design rules under a new name. - + - - + + - + @@ -1218,7 +1213,7 @@ design rules under a new name. - + @@ -1230,7 +1225,7 @@ design rules under a new name. - + @@ -1242,7 +1237,7 @@ design rules under a new name. - + @@ -1255,7 +1250,7 @@ design rules under a new name. - + @@ -1268,7 +1263,7 @@ design rules under a new name. - + @@ -1283,7 +1278,7 @@ design rules under a new name. - + @@ -1298,7 +1293,7 @@ design rules under a new name. - + @@ -1312,7 +1307,7 @@ design rules under a new name. - + @@ -1326,7 +1321,7 @@ design rules under a new name. - + @@ -1341,8 +1336,11 @@ design rules under a new name. - - + + + + + @@ -1369,7 +1367,7 @@ design rules under a new name. - + @@ -1392,9 +1390,9 @@ design rules under a new name. - - - + + + @@ -1403,7 +1401,7 @@ design rules under a new name. - + @@ -1417,14 +1415,17 @@ design rules under a new name. - - + + + + + - - + + diff --git a/flight-panel-2021-11/Flight Panel 2021-11.sch b/flight-panel-2021-11/Flight Panel 2021-11.sch index 9b2c16a..22fb3cb 100644 --- a/flight-panel-2021-11/Flight Panel 2021-11.sch +++ b/flight-panel-2021-11/Flight Panel 2021-11.sch @@ -2316,36 +2316,36 @@ Holes are offset 0.005" to hold pins in place while soldering. - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + @@ -2360,27 +2360,27 @@ Holes are offset 0.005" to hold pins in place while soldering. - + - + - + - + - + - + @@ -2392,15 +2392,15 @@ Holes are offset 0.005" to hold pins in place while soldering. - + - + - + @@ -2411,55 +2411,55 @@ Holes are offset 0.005" to hold pins in place while soldering. - + - + - + - + - + - + - + - - - + + + - - - + + + - - - + + + - + - + - + @@ -2467,15 +2467,15 @@ Holes are offset 0.005" to hold pins in place while soldering. - - - + + + - - - + + + - + @@ -2485,7 +2485,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2505,72 +2505,72 @@ Holes are offset 0.005" to hold pins in place while soldering. @@ -2643,7 +2643,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2652,7 +2652,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2661,7 +2661,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2670,7 +2670,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2679,7 +2679,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2687,7 +2687,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2697,7 +2697,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2728,7 +2728,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2736,7 +2736,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2745,7 +2745,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2755,52 +2755,52 @@ Holes are offset 0.005" to hold pins in place while soldering. - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2810,7 +2810,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2819,7 +2819,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2827,7 +2827,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2837,7 +2837,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2846,7 +2846,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2854,7 +2854,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2908,7 +2908,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + @@ -2928,20 +2928,20 @@ Holes are offset 0.005" to hold pins in place while soldering. - + - + - + @@ -2954,7 +2954,7 @@ Holes are offset 0.005" to hold pins in place while soldering. - + diff --git a/flight-panel-2021-11/flight-panel.ino b/flight-panel-2021-11/flight-panel.ino index e83e959..97a74bf 100644 --- a/flight-panel-2021-11/flight-panel.ino +++ b/flight-panel-2021-11/flight-panel.ino @@ -1,53 +1,75 @@ #include +#include Joystick joystick(false); +// These defines match the board schematic +#define ENC1 2, 3 +#define ENC2 4, 5 +#define BTN1 6 +#define BTN2 7 +#define BTN3 8 +#define BTN4 9 +#define BTN5 10 +#define BTN6 11 +#define BTN7 12 +#define BTN8 13 +#define BTN9 A0 + +// Buttons 10 and higher are all on A1 (the MUX signal pin), these are multiplexer channel IDs +#define BTN10 0 +#define BTN11 1 +#define BTN12 2 +#define BTN13 3 +#define BTN14 4 +#define BTN15 5 +#define BTN16 6 +#define BTN17 7 +#define BTN18 8 +#define BTN19 9 +#define BTN20 10 +#define BTN21 11 +#define BTN22 12 +#define KBTN1 13 +#define KBTN2 14 +#define KBTN3 15 + 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); + // Encoders + joystick.AddEncoder(ENC1, ENCODER_PULSED_SPLIT); + joystick.AddEncoder(ENC2, ENCODER_PULSED_SPLIT); // // 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); + joystick.AddButton(BTN1, BUTTON_PULSED_DOUBLE_ACTION_SPLIT); + joystick.AddButton(BTN2, BUTTON_PULSED_DOUBLE_ACTION_SPLIT); + joystick.AddButton(BTN3, BUTTON_PULSED_DOUBLE_ACTION_SPLIT); + joystick.AddButton(BTN4, 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); + joystick.AddButton(BTN5, BUTTON_PASSTHRU); + joystick.AddButton(BTN6, BUTTON_PASSTHRU); + joystick.AddButton(BTN7, BUTTON_PASSTHRU); // // Mining Modules - joystick.AddButton(9, BUTTON_PASSTHRU); - joystick.AddButton(10, BUTTON_PASSTHRU); - joystick.AddButton(11, BUTTON_PASSTHRU); + joystick.AddButton(BTN8, BUTTON_PASSTHRU); + joystick.AddButton(BTN9, BUTTON_PASSTHRU); + joystick.AddButton(BTN10, BUTTON_PASSTHRU, true, mux); // // Flight Modes - joystick.AddButton(A1, BUTTON_PASSTHRU); - joystick.AddButton(A2, BUTTON_PASSTHRU); - joystick.AddButton(A3, BUTTON_PASSTHRU); - joystick.AddButton(A4, BUTTON_PASSTHRU); + joystick.AddButton(BTN11, BUTTON_PASSTHRU, true, mux); + joystick.AddButton(BTN12, BUTTON_PASSTHRU, true, mux); + joystick.AddButton(BTN13, BUTTON_PASSTHRU, true, mux); + joystick.AddButton(BTN14, BUTTON_PASSTHRU, true, mux); // // Doors & Lights - // // TODO: Need multiplexer setup - joystick.AddButton(12, BUTTON_PULSED_DOUBLE_ACTION); - joystick.AddButton(A0, BUTTON_PULSED_DOUBLE_ACTION); + joystick.AddButton(BTN15, BUTTON_PULSED_DOUBLE_ACTION, true, mux); + joystick.AddButton(BTN16, BUTTON_PULSED_DOUBLE_ACTION_SPLIT, true, mux); + joystick.AddButton(BTN17, BUTTON_PULSED_DOUBLE_ACTION_SPLIT, true, mux); // // Emergency Panel - // // TODO: Need multiplexer setup - joystick.AddButton(A5, BUTTON_PASSTHRU); + joystick.AddButton(KBTN1, BUTTON_PASSTHRU); + joystick.AddButton(KBTN2, BUTTON_PASSTHRU); + joystick.AddButton(KBTN3, BUTTON_PASSTHRU); joystick.Init(); }