0

3787 1.54 inch 240 x 240 TFT will not display anything
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

3787 1.54 inch 240 x 240 TFT will not display anything

by sureug on Wed Jan 02, 2019 4:50 pm

I have a ESP8266 D1 Mini Pro wired to a 3787 display and can not get anything to display. I have it wired as shown in my code. I have tried 2 displays and 2 ESP8266. I don't believe I have a hardware problem.
Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GFX.h>    // Core graphics library
//#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>

#ifdef ADAFRUIT_HALLOWING
//  #define TFT_CS        D8 // Hallowing display control pins: chip select
//  #define TFT_RST       D0 // Display reset
//  #define TFT_DC        D4 // Display data/command select
//  #define TFT_BACKLIGHT D1 // Display backlight pin
#else
  // For the breakout board, you can use any 2 or 3 pins.
  // These pins will also work for the 1.8" TFT shield.
  #define TFT_CS        D8
  #define TFT_RST       D0 // Or set to -1 and connect to Arduino RESET pin
  #define TFT_DC        D4
#endif

// OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique
// to each board and not reassignable. For Arduino Uno: MOSI = pin 11 and
// SCLK = pin 13. This is the fastest mode of operation and is required if
// using the breakout board's microSD card.

// For 1.44" and 1.8" TFT with ST7735 (including HalloWing) use:
//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

// For 1.54" TFT with ST7789:
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

// OPTION 2 lets you interface the display using ANY TWO or THREE PINS,
// tradeoff being that performance is not as fast as hardware SPI above.
#define TFT_MOSI D7  // Data out
#define TFT_SCLK D5  // Clock out
//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

float p = 3.1415926;

void setup(void) {
  Serial.begin(9600);
  Serial.print(F("Hello! ST77xx TFT Test"));

#ifdef ADAFRUIT_HALLOWING
  // HalloWing is a special case. It uses a ST7735R display just like the
  // breakout board, but the orientation and backlight control are different.
  tft.initR(INITR_HALLOWING);        // Initialize HalloWing-oriented screen
  pinMode(TFT_BACKLIGHT, OUTPUT);
  digitalWrite(TFT_BACKLIGHT, HIGH); // Backlight on
#else
  // Use this initializer if using a 1.8" TFT screen:
  //tft.initR(INITR_BLACKTAB);      // Init ST7735S chip, black tab

  // OR use this initializer (uncomment) if using a 1.44" TFT:
  //tft.initR(INITR_144GREENTAB); // Init ST7735R chip, green tab

  // OR use this initializer (uncomment) if using a 0.96" 180x60 TFT:
  //tft.initR(INITR_MINI160x80);  // Init ST7735S mini display

  // OR use this initializer (uncomment) if using a 1.54" 240x240 TFT:
  tft.init(240, 240);           // Init ST7789 240x240
#endif

  Serial.println(F("Initialized"));

  uint16_t time = millis();
  tft.fillScreen(ST77XX_BLACK);
  time = millis() - time;

  Serial.println(time, DEC);
  delay(500);

  // large block of text
//  tft.fillScreen(ST77XX_BLACK);
//  testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", ST77XX_WHITE);
//  delay(10000);

  // tft print function!
  tftPrintTest();
//  delay(4000);

 
  Serial.println("done");
  delay(1000);
}

void loop()
 //invertDisplay is used to change the background from black to white
{
  tft.invertDisplay(false); // set to true to invert display
  delay(5000);
  tft.invertDisplay(false);
  delay(5000);
}

void testlines(uint16_t color) {
  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, 0, x, tft.height()-1, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, 0, tft.width()-1, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, 0, 0, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, tft.height()-1, x, 0, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);
    delay(0);
  }
}
void testdrawtext(char *text, uint16_t color) {
  tft.setCursor(0, 0);
  tft.setTextColor(color);
  tft.setTextWrap(true);
  tft.print(text);
}

void tftPrintTest() {
  //tft.setRotation(tft.getRotation()+1);  //Rotates the text on the screen 90 Deg to the right   
 
  tft.setTextWrap(false);
  tft.fillScreen(ST77XX_BLACK);
  tft.setCursor(0, 10);
  tft.setTextColor(ST77XX_RED);
  tft.setTextSize(1);
  tft.println("Test");
  tft.setTextColor(ST77XX_YELLOW);
  tft.setTextSize(2);
  tft.println(" Test");
  tft.setTextColor(ST77XX_ORANGE);
  tft.setTextSize(3);
  tft.println("Test");
  tft.setTextColor(ST77XX_GREEN);
  tft.setTextSize(3);
  tft.println(" Test");
  tft.setTextColor(ST77XX_BLUE);
  tft.setTextSize(3);
  tft.println("Test");
}
Attachments
20190103_113930.jpg
20190103_113930.jpg (38.3 KiB) Viewed 98 times
20190103_113557.jpg
20190103_113557.jpg (52.29 KiB) Viewed 98 times
Last edited by sureug on Thu Jan 03, 2019 2:03 pm, edited 3 times in total.

sureug
 
Posts: 1
Joined: Mon Dec 17, 2018 4:44 pm

Re: 3787 1.54 inch 240 x 240 TFT will not display anything

by adafruit_support_carter on Wed Jan 02, 2019 9:30 pm

Post a photo showing how you have everything connected.

adafruit_support_carter
 
Posts: 11064
Joined: Tue Nov 29, 2016 2:45 pm

Re: 3787 1.54 inch 240 x 240 TFT will not display anything

by adna on Sun Feb 17, 2019 6:30 pm

3787: so promising and so frustrating.
There is _nothing_ on the project page except links and tutorials for _other_ TFTs with different
pin configurations. I can't believe this is so hard to find.

I just need the simplest: What are the pin outs connected in some example code.
There's no documentation of how to hook this up to, for example, a Feather Wing, Arduino, etc.
Can anyone please point me to a paragraph or a photo that says:
"Hook up these pins from the TFT to (whatever Feather, Arduino, Metro...) and run this code.
Can anyone point me to docs for this product?
Thank you!

adna
 
Posts: 4
Joined: Sat Mar 26, 2011 9:09 pm

Re: 3787 1.54 inch 240 x 240 TFT will not display anything

by adafruit_support_carter on Mon Feb 18, 2019 2:52 pm

@adna Can you please start a new thread for your question.

adafruit_support_carter
 
Posts: 11064
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.