Adafruit_ST7789 not working with GMT130-V1.0 display (ST7789VW 1.3" 240x240)

I am not able to get this screen working with the Adafruit library, but it works fine with the TFT_eSPI library. (CS pin not exposed)


The ILI9341 was just for testing, I have no real purpose to use 2 displays, and even if I remove it from the sketch the ST7789 still does not work.
ILI9341 works just fine with the Adafruit library or the TFT_eSPI library.

#include <SPI.h>
#include <Adafruit_ILI9341.h>
#include <Adafruit_ST7789.h>

const uint8_t vBattPin = 14;

#define ILI9341_TFT_CS 9
#define ILI9341_TFT_DC 10
#define ILI9341_TFT_MOSI 11
#define ILI9341_TFT_SCLK 12
#define ILI9341_TFT_RST -1
#define ILI9341_TFT_MISO 13
Adafruit_ILI9341 ILI9341 = Adafruit_ILI9341(ILI9341_TFT_CS, ILI9341_TFT_DC, ILI9341_TFT_MOSI, ILI9341_TFT_SCLK, ILI9341_TFT_RST, ILI9341_TFT_MISO);

#define ST7789_TFT_CS -1
#define ST7789_TFT_DC 16
#define ST7789_TFT_MOSI 17
#define ST7789_TFT_SCLK 18
#define ST7789_TFT_RST -1
Adafruit_ST7789 ST7789 = Adafruit_ST7789(ST7789_TFT_CS, ST7789_TFT_DC, ST7789_TFT_MOSI, ST7789_TFT_SCLK, ST7789_TFT_RST);

void setup() 
{
    pinMode(vBattPin, INPUT);

    ILI9341.begin();
    ILI9341.fillScreen(ILI9341_BLACK);
    ILI9341.setRotation(1);

    ST7789.init(240, 240);
    ST7789.fillScreen(ST77XX_BLACK);
    ST7789.setRotation(1);
}

void loop() 
{
    int voltage = analogRead(vBattPin) * 2;
    static String mV = "mV";

    ILI9341.setCursor(100, 125);
    ILI9341.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
    ILI9341.print(voltage);
    ILI9341.setCursor(125, 125);
    ILI9341.println(mV);

    ST7789.setCursor(100, 125);
    ST7789.setTextColor(ST77XX_WHITE, ST77XX_BLACK);
    ST7789.print(voltage);
    ST7789.setCursor(125, 125);
    ST7789.println(mV);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.