From 511beae681fbf76ce45e5fd912ffb9f261161068 Mon Sep 17 00:00:00 2001 From: Zvonimir Rudinski Date: Tue, 28 Apr 2026 19:21:07 +0200 Subject: [PATCH] chore: remove joystick logging --- include/display.hpp | 1 - include/joystick.hpp | 2 -- src/display.cpp | 13 ------------- src/main.cpp | 11 +---------- 4 files changed, 1 insertion(+), 26 deletions(-) diff --git a/include/display.hpp b/include/display.hpp index 9a69320..59603f4 100644 --- a/include/display.hpp +++ b/include/display.hpp @@ -10,7 +10,6 @@ class Display { Display(uint8_t addr = 0x27, uint8_t cols = 20, uint8_t rows = 4); void begin(); - void drawJoystick(double x, double y, bool pressed); private: LiquidCrystal_I2C lcd; }; diff --git a/include/joystick.hpp b/include/joystick.hpp index 441089b..f8b53f4 100644 --- a/include/joystick.hpp +++ b/include/joystick.hpp @@ -11,8 +11,6 @@ * * Note: The button is active LOW and requires a pull-up resistor, which can either be external (10kΩ) * or the internal pull-up resistor of the microcontroller (default). - * - * TODO: Add "deadzone" handling to prevent small joystick movements from being registered as input. */ class Joystick { public: diff --git a/src/display.cpp b/src/display.cpp index 168ea8e..334138d 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -8,17 +8,4 @@ void Display::begin() { lcd.backlight(); } -// TODO: Remove this method in the future -void Display::drawJoystick(double x, double y, bool pressed) { - lcd.clear(); - lcd.setCursor(0, 0); - lcd.print("X:"); - lcd.print(x, 2); // Print X value with 2 decimal places - lcd.print(" Y:"); - lcd.print(y, 2); // Print Y value with 2 decimal places - - lcd.setCursor(0, 1); - lcd.print("Pressed: "); - lcd.print(pressed ? "Yes" : "No"); -} diff --git a/src/main.cpp b/src/main.cpp index 86c09a7..f358aa1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,13 +17,4 @@ void setup() { } void loop() { - double x = joystick.getX(); - double y = joystick.getY(); - bool pressed = joystick.isPressed(); - - printf("X: %.2f | Y: %.2f | Pressed: %s\n", x, y, pressed ? "Yes" : "No"); - display.drawJoystick(x, y, pressed); - - digitalWrite(LED_BUILTIN, pressed ? HIGH : LOW); - - delay(500);} +}