From f576102af6b9b5dc489a687ab8225fa26de99338 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Tue, 21 Dec 2021 04:58:41 +0000 Subject: [PATCH] Fix encoders. --- flight-panel-2021-11/flight-panel-2021-11.ino | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flight-panel-2021-11/flight-panel-2021-11.ino b/flight-panel-2021-11/flight-panel-2021-11.ino index 8a14fa3..55cb6d8 100644 --- a/flight-panel-2021-11/flight-panel-2021-11.ino +++ b/flight-panel-2021-11/flight-panel-2021-11.ino @@ -1,7 +1,7 @@ #include #include -Joystick joystick(false); +Joystick joystick(true); // These defines match the board schematic #define ENC1 2, 4 @@ -41,12 +41,13 @@ Joystick joystick(false); void setup() { // Encoders - joystick.AddEncoder(ENC1, ENCODER_PULSED_SPLIT); - joystick.AddEncoder(ENC2, ENCODER_PULSED_SPLIT); + joystick.AddEncoder(ENC1, 4, ENCODER_PULSED_SPLIT); + joystick.AddEncoder(ENC2, 4, ENCODER_PULSED_SPLIT); // We will add the 2-stage "key buttons" in a slightly odd order // in order to keep columns together for faster scanning. - Matrix* matrix = new Matrix({C0, C1, C2, C3}, 4); + uint8_t columns[] = {C0, C1, C2, C3}; + Matrix* matrix = new Matrix(columns, 4); // Flight modes joystick.AddMatrixButton(BTN1, matrix, BUTTON_PASSTHRU);