espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.43k stars 7.38k forks source link

change GPIO 18,19 on SD card adapter #2218

Closed krab-skunk closed 5 years ago

krab-skunk commented 5 years ago

Hardware:

Board: TTGO Lora32 v1

Description:

According this schema: https://github.com/espressif/arduino-esp32/tree/master/libraries/SD/

But on this board i have, https://cdn-images-1.medium.com/max/1600/1*t9c7j4894YWCy5bBWkyhlQ.jpeg there is no GPIO 18, 19 and 5, is there any way i can modify it to adapt to my free available GPIO, like 25, 34, 35 etc..?

For CS pin, i already know as its written: SD.begin(CSpin), but for the others, i'm not quite sure

Thanks a lot

*ps: i've tried on regular esp32 devkit v1 and it works gr8! ;)

atanisoft commented 5 years ago

you can specify whichever pins you want by passing in a local SPI instance:

SPIClass sdSPI;
sdSPI.begin(SCK, MISO, MOSI, SS);
SD.begin(CSpin, sdSPI);
krab-skunk commented 5 years ago

Thanks a lot for your help, that's really a good news! 👍