0

3.5" TFT does not respond to rotate.
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

3.5" TFT does not respond to rotate.

by eqrunner on Mon Dec 23, 2019 8:15 pm

I am in the beginning stages of trying to make a display with a new 3.5 TFT screen.
Ran the stock graphicstest script for this HX8537 screen. It works fine. But when I try to change anything, (say commenting out a single tft.println) the colors will shift. So I have stripped down all the code to something basic to work with and have introduced a new issue. Rotation. I have changed the value for tft.setRotation() from 0, 1, 2, and 3. and the screen does not change rotation.

What is wrong?

Code: Select all | TOGGLE FULL SIZE

/***************************************************
  This is our library for the Adafruit HX8357D Breakout
  ----> http://www.adafruit.com/products/2050

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_HX8357.h"



// These are 'flexible' lines that can be changed
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8 // RST can be set to -1 if you tie it to Arduino's reset

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, TFT_RST);

// SoftSPI - note that on some processors this might be *faster* than hardware SPI!
//Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, MOSI, SCK, TFT_RST, MISO);






void setup() {
  Serial.begin(9600);

  Serial.println("HX8357D Test!");


  tft.begin();
  // tft.setRotation(2);
  tft.setRotation(1);
  //tft.invertDisplay(0);
  tft.setAddrWindow(0, 0, 320, 480);
  delay(1000);
  tft.fillScreen(HX8357_BLACK);
  delay(1000);
}


void loop(void) {
  //tft.setRotation(3);
  //tft.setCursor(0, 0);
  //tft.setTextColor(0xCCCC);
  //tft.setTextSize(3);
  tft.println("Hello World!");

  Serial.print("RDMADCTL  ");
  Serial.println(HX8357_RDMADCTL, HEX);

  delay(1000);
}
eqrunner
 
Posts: 3
Joined: Fri Jan 28, 2011 8:32 pm

Re: 3.5" TFT does not respond to rotate.

by eqrunner on Thu Dec 26, 2019 8:32 pm

SOLVED:

Was using v1.7.2 Adafruit_GFX.h. This version is broken. Use v 1.5.3 and it rotation works great!

Thanks to this post for answers: https://github.com/adafruit/TFTLCD-Library/issues/37
eqrunner
 
Posts: 3
Joined: Fri Jan 28, 2011 8:32 pm

Please be positive and constructive with your questions and comments.