WRT programming I'm a relative newbie, but have successfully used several Arduino Nano boards for projects (I'm an old-school military Electronics Tech).
I thought I'd step up to the ESP32's, so I bought a coupe of the R32 (UNO-form) boards, to specifically use with a 3.5" TFT Touch display.
I also bought some regular 38-pin ESP32 boards as well. (ESP-WROOM-32 based)
But - Here's my immediate problem...
How do you define the pins for the ESP32's ??
I mean - With the Nano boards you have Actual Pin numbers, so use obvious code such as: pinMode(2, OUTPUT);
But the ESP32's list all the pins (on the PCB) as 'GPIO26' etc.
I haven't been able to find anything on-line, to tell my which physical "Pin Number" corresponds to the 'GPIOxx' labels... And there seem to be So Many variants of boards out there to "muddy the waters".
Schematics don't seem to lead me to the answer either.
Am I missing something obvious ??
Do you simply use the GPIO number - i.e.: GPIO26 = Pin26 ??
If someone could point me in the right direction, I'll be eternally grateful !
Ta Muchly.
..\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32\esp32-hal-gpio.c and .h
handles most of the stuff
The ..\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\variants\esp32thing\pins_arduino.h
handles the actual mapping of names like TX RX A0 etc to pin numbers (GPIOxx numbers)
So yes just use 26 for GPIO26 provided that pin has the functionality you need.
Have a close look at SparkFun ESP32 Thing board and the variants\esp32thing\pins_arduino.h it uses. You will see it is only the 'special' named pins that are mapped like SDA SCL A0.. etc the rest are just accessed by number (the GPIO number)
e.g. pinMode(2, OUTPUT);
sets GPIO2 as an output.
Then choose a board variant that has the same pins available as your ESP32 module. The SparkFun ESP32 Thing has very complete break out of the chip pins. I am using it as the test bed before moving to an Adafruit moldule The Adafruit module is missing pins 37 and 38 compared to the SparkFun board