all of the examples under GFX Library for Arduino not work,

dssman
Posts: 17
Joined: Thu May 26, 2022 4:37 pm

all of the examples under GFX Library for Arduino not work,

Postby dssman » Wed Sep 14, 2022 7:20 pm

Hi everyone.
I tested my ESP32 with GC9A01, the examples from GFX Library for Arduino not work at all, why?
such as this one: ImgViewerJpeg
I did modification as below:
//Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 3 /* rotation */, false /* IPS */);
Arduino_GFX *gfx = new Arduino_GC9A01( bus, 7 /* RST */, 0 /* rotation */, true /* IPS */);

Code: Select all


#include <Arduino_GFX_Library.h>

#define GFX_BL DF_GFX_BL // default backlight pin, you may replace DF_GFX_BL to actual backlight pin

/* More dev device declaration: https://github.com/moononournation/Arduino_GFX/wiki/Dev-Device-Declaration */
#if defined(DISPLAY_DEV_KIT)
Arduino_GFX *gfx = create_default_Arduino_GFX();
#else /* !defined(DISPLAY_DEV_KIT) */

/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_DataBus *bus = create_default_Arduino_DataBus();

/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
//Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false /* IPS */);
Arduino_GFX *gfx = new Arduino_GC9A01(bus, 7 /* RST */, 3 /* rotation */, true /* IPS */);

#endif /* !defined(DISPLAY_DEV_KIT) */
/*******************************************************************************
 * End of Arduino_GFX setting
 ******************************************************************************/

void setup(void)
{
    gfx->begin();
    gfx->fillScreen(BLACK);

#ifdef GFX_BL
    pinMode(GFX_BL, OUTPUT);
    digitalWrite(GFX_BL, HIGH);
#endif

    gfx->setCursor(10, 10);
    gfx->setTextColor(RED);
    gfx->println("Hello World!");

    delay(5000); // 5 seconds
}

void loop()
{
    gfx->setCursor(random(gfx->width()), random(gfx->height()));
    gfx->setTextColor(random(0xffff), random(0xffff));
    gfx->setTextSize(random(6) /* x scale */, random(6) /* y scale */, random(2) /* pixel_margin */);
    gfx->println("Hello World!");

    delay(1000); // 1 second
}


lbernstone
Posts: 792
Joined: Mon Jul 22, 2019 3:20 pm

Re: all of the examples under GFX Library for Arduino not work,

Postby lbernstone » Wed Sep 14, 2022 10:07 pm

I have no idea if this library will work under esp32, but pins 6-11 are in use by the SPI flash. Trying to use them will typically cause the system to crash.

dssman
Posts: 17
Joined: Thu May 26, 2022 4:37 pm

Re: all of the examples under GFX Library for Arduino not work,

Postby dssman » Thu Sep 15, 2022 2:09 am

Thank you.
if you mentioned the " 7 ", it's not the point as my understand, because any number (such like 33) changed there same result.
and it is data bus protocol.

Who is online

Users browsing this forum: No registered users and 146 guests