adafruit / Adafruit-ST7735-Library

This is a library for the Adafruit 1.8" SPI display http://www.adafruit.com/products/358 and http://www.adafruit.com/products/618
https://learn.adafruit.com/1-8-tft-display
547 stars 303 forks source link

ST7735 lib - Text mirror problem #157

Open classic-audio opened 2 years ago

classic-audio commented 2 years ago

Display: 80x160 color TFT display (driver ST7735S SPI ) Arduino: Arduino ProMini 3V3

I have downloaded the latest Adafruit-ST7735-Library yesterday.

The problem: The text is displayed mirrowed (see pickture below)

The question: how can I correct that problem?

display

The test sketch:

include

include

Adafruit_ST7735 lcd = Adafruit_ST7735(9,10,8); //--- LCD color def. --------------------------------

define BLACK 0x000

define BLUE 0x001F

define GREEN 0x07E0

define YELLOW 0xFFE0

define WHITE 0xFFFF

define GREY 0x652F

define RED 0xF800

define OLIVE 0x7BE0

define ORANGE 0xFD20

void setup(void){ // --- Display ----------------------------------- lcd.initR(INITR_MINI160x80);

lcd.invertDisplay(1); lcd.setRotation(2); lcd.fillScreen(BLACK); }

void loop(){ lcd.setTextColor(GREEN); lcd.setCursor(0,0);lcd.print("CLASSIC AUDIO"); lcd.setTextColor(RED); lcd.setCursor(0,15);lcd.print("DESIGN"); lcd.setTextColor(YELLOW); lcd.setCursor(0,25);lcd.print("Attenuator"); while(1); }

davidneosys commented 1 year ago

hi, did you solve that problem? I also had same problem. please share your modification.

ideva-SAS commented 1 year ago

hi

change ST77XX_MADCTL_MY 0x80 to 0x00 in Adafruit_ST77xx.h

YonLiud commented 1 week ago

change ST77XX_MADCTL_MY 0x80 to 0x00 in Adafruit_ST77xx.h

I found an alternative solution. While your approach was correct, my display required flipping the image along the X-axis instead of the Y-axis. I assume this adjustment was also necessary for classic-audio.


#define ST77XX_MADCTL_MY 0x80
- #define ST77XX_MADCTL_MX 0x40
+ #define ST77X_MADCTL_MX 0x00
#define ST77XX_MADCTL_MV 0x20
#define ST77XX_MADCTL_ML 0x10
#define ST77XX_MADCTL_RGB 0x00