From 128aa0c38660b3391b35329f5acab4f5e7b2f282 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 7 Oct 2025 00:48:01 +0100 Subject: [PATCH] Removed unused code --- src/main.cpp | 51 +++++---------------------------------------------- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c1a9fb5..1ba6448 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -179,49 +179,11 @@ void setup() { // unsigned long lastPrint = 0; void loop(void) { unsigned long currentMillis = millis(); - // for (size_t r = 0; r < NUM_ROWS; r++) { - // SR595N_write(&input, rows[r]); - // byte result = SR165_read(&output); - // for (size_t c = 0; c < NUM_COLS; c++) { - // uint8_t reading = (result & colMasks[c]) ? HIGH : LOW; - // int buttonIndex = r * NUM_COLS + c; - // - // // Debounce logic - // if (reading != lastReading[r][c]) { - // lastDebounceTime[r][c] = currentMillis; - // } - // - // if ((currentMillis - lastDebounceTime[r][c]) > debounceDelay) { - // if (reading != debouncedBtns[r][c]) { - // - // // Uncomment this to have buttons acting normally - // // Joystick.setButton(buttonIndex, (reading == LOW)); - // // Uncomment this to have buttons acting like keys - // if (isPulseButton(buttonIndex)) { - // if (reading != debouncedBtns[r][c]) { - // Joystick.setButton(buttonIndex, HIGH); - // pulseStartTime[buttonIndex] = currentMillis; - // isPulsing[buttonIndex] = true; - // } else { - // Joystick.setButton(buttonIndex, (reading == LOW)); - // } - // } - // - // debouncedBtns[r][c] = reading; - // } - // } - // - // lastReading[r][c] = reading; - // } - // } - // - // for (int i = 0; i < JOYSTICK_BTN_COUNT; i++) { - // if (isPulsing[i] && (currentMillis - pulseStartTime[i]) > PULSE_DURATION) { - // Joystick.setButton(i, 0); - // isPulsing[i] = false; - // } - // } - + + int dir = RotaryEncoder_read(&re1); + if (dir != lastRE) { + Serial.println(dir); + } for (size_t r = 0; r < NUM_ROWS; r++) { @@ -266,9 +228,6 @@ void loop(void) { } - - - // if (millis() - lastPrint >= 50) { // Serial.print("\033[2J\033[H"); // for (size_t row = 0; row < NUM_ROWS; row++) {