From 86f27d41700eac89656f2502868513fce61e4e2a Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 21 Oct 2025 23:56:16 +0100 Subject: [PATCH] Changed the press duration for the rotary encoder in hopes games detect it btr --- src/main.cpp | 6 +++++- src/rotaryEncoder.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index d0a19f6..1ef1aa9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -184,9 +184,13 @@ uint8_t joystickREPos(int8_t dir, size_t encPos) { return btn; } +// TODO +// Make this non blocking: +// - Set it has high, and on the following loops check if the required duration +// has elapsed to release it void rotateRE(int8_t pos) { Joystick.setButton(pos, HIGH); - delayMicroseconds(1000); + delayMicroseconds(RE_PULSE_DURATION); Joystick.setButton(pos, LOW); } diff --git a/src/rotaryEncoder.h b/src/rotaryEncoder.h index e941850..b736d07 100644 --- a/src/rotaryEncoder.h +++ b/src/rotaryEncoder.h @@ -4,6 +4,7 @@ const int RE_NOCHANGE = 0; const int RE_CCW = -1; const int RE_CW = 1; +const int RE_PULSE_DURATION = 20000; // microsseconds typedef struct { int clkPin;