Page 1 of 1

about gpio33 and 27 question

Posted: Mon Sep 12, 2022 2:26 am
by dssman
Hi everyone,
the GFX for Arduino used GPIO27 and 33, for DC and RST, can it be changed ?say : RST = 12?
thanks
Adam

Re: about gpio33 and 27 question

Posted: Tue Sep 13, 2022 6:54 am
by ESP_LJH
Yes, you could use GPIO12 as RESET and make sure hardware connection is also altered.

Re: about gpio33 and 27 question

Posted: Tue Sep 13, 2022 6:22 pm
by dssman
Thank you.
what this line meaning:
Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 3 /* rotation */, false /* IPS */);
does it mean: DF_GFX_RST = 3 ?
this from the example code of the library: GFX for Arduino

Re: about gpio33 and 27 question

Posted: Wed Sep 14, 2022 12:08 pm
by gtjoseph
3 is the screen rotation

Re: about gpio33 and 27 question

Posted: Wed Sep 14, 2022 6:53 pm
by dssman
DF_GFX_RST = ?

Re: about gpio33 and 27 question

Posted: Wed Sep 14, 2022 11:15 pm
by gtjoseph
dssman wrote:
Wed Sep 14, 2022 6:53 pm
DF_GFX_RST = ?
It's hard to tell because I don't know exactly what "GFX for Arduino" library you're talking about. Got a link?

Re: about gpio33 and 27 question

Posted: Thu Sep 15, 2022 3:15 am
by dssman

Re: about gpio33 and 27 question

Posted: Thu Sep 15, 2022 3:34 pm
by gtjoseph
If youi look in that library's Arduino_GFX_Library.h file you'll see

Code: Select all

#define DF_GFX_RST GFX_NOT_DEFINED
It appears that DF_GFX_RST should be assigned to the GPIO that's connected to the display's RESET pin if it has one so in your code, you'll have to do something like...

Code: Select all

#undef DF_GFX_RST
#define DF_GFX_RST GPIO_NUM_nn 
where "nn" is the actual gpio number connected.

You'll probably want to direct any further questions about using this library to the library maintainers.

Re: about gpio33 and 27 question

Posted: Thu Sep 15, 2022 6:38 pm
by dssman
Thank you a lot gtjoseph.
As you checked into the Library file, I'd like to ask some thing confused me, that are:

1. seems the ESP32 goes into two totally different branches? I have two laptops one is WIN7; and the other one is WIN10 with the Arduino core for the ESP updated. some sketches be able to compile in WIN7 only and some sketches can be compiled in WIN10 only, why?

2. the pin combination for DC/RST, some code with: DC=2, RST=4, (can be any pin? ) works well; but no work at all as long as changed setting as DC=27, RST = 33 (GFX_Arduino need), why?

3. on WIN10 used a ESP32-WROOM-32 board: the example from GFX LIBRARY FOR ARDUINO compiling well when selected board: ESP32-WROOM-DA MODULE, but got compiling errors when selected ESP32 Dev Module, why?
the same board be able to compile when selected ESP32-Dev Module with other sketch which doesn't use GFX FOR ARDUINO library.

Best.
Adam

Re: about gpio33 and 27 question

Posted: Fri Sep 16, 2022 11:09 am
by gtjoseph
dssman wrote:
Thu Sep 15, 2022 6:38 pm
Thank you a lot gtjoseph.
As you checked into the Library file, I'd like to ask some thing confused me, that are:

1. seems the ESP32 goes into two totally different branches? I have two laptops one is WIN7; and the other one is WIN10 with the Arduino core for the ESP updated. some sketches be able to compile in WIN7 only and some sketches can be compiled in WIN10 only, why?
I have no idea. I don't use Windows or the Arduino core. Sorry.
dssman wrote:
Thu Sep 15, 2022 6:38 pm
2. the pin combination for DC/RST, some code with: DC=2, RST=4, (can be any pin? ) works well; but no work at all as long as changed setting as DC=27, RST = 33 (GFX_Arduino need), why?
The library itself shouldn't care which actual GPIOs you're using as long as they're appropriate for the ESP32 module/board you're using. I think they just used 27/33 as defaults or examples.
dssman wrote:
Thu Sep 15, 2022 6:38 pm
3. on WIN10 used a ESP32-WROOM-32 board: the example from GFX LIBRARY FOR ARDUINO compiling well when selected board: ESP32-WROOM-DA MODULE, but got compiling errors when selected ESP32 Dev Module, why?
the same board be able to compile when selected ESP32-Dev Module with other sketch which doesn't use GFX FOR ARDUINO library.
I don't use the library so I can't help you here either, sorry.