Skip to content

Commit

Permalink
[scannerGraphic] make X_OFFSET calc agnostic of display type
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Mar 4, 2024
1 parent 49a1f13 commit 23ee59a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/scannerGraphic/scannerGraphic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
********************************************************************/
Expand Down

0 comments on commit 23ee59a

Please sign in to comment.