From 23ee59a3b43a2f47bd6ca7612e8c43e39307ba7e Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 4 Mar 2024 02:00:42 -0800 Subject: [PATCH] [scannerGraphic] make X_OFFSET calc agnostic of display type --- examples/scannerGraphic/scannerGraphic.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/scannerGraphic/scannerGraphic.ino b/examples/scannerGraphic/scannerGraphic.ino index a8d7ffea..dad243a3 100644 --- a/examples/scannerGraphic/scannerGraphic.ino +++ b/examples/scannerGraphic/scannerGraphic.ino @@ -85,7 +85,6 @@ Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); #define WHITE SSD1306_WHITE #define REFRESH ({ display.display(); }) #define CLEAR_DISPLAY ({ display.clearDisplay(); }) -#define X_OFFSET 0 #elif defined(SPI_DISPLAY) @@ -105,10 +104,11 @@ Adafruit_ST7789 display = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST); #define WHITE ST77XX_WHITE #define REFRESH #define CLEAR_DISPLAY ({ display.fillScreen(BLACK); }) -#define X_OFFSET (SCREEN_WIDTH - 128) / 2 #endif // if defined(I2C_DISPLAY) || defined(SPI_DISPLAY) +#define X_OFFSET (SCREEN_WIDTH - (num_channels + 2)) / 2 + /******************************************************************** * Configure debugging on Serial output ********************************************************************/