Hi,
I am working with the ADF example play_sdcard_mp3_example in the Lyrat board.
I can play the test.mp3 but now I want to do operations with the SDcard like open files, list files... etc. Since the SDcard was initialized in
audio_board_sdcard_init(), how can I get the sdcard handler that is used in the IDF example? sdmmc_card_t
How to get the sdcard handler in the ADF read MP3 from sdcard example
Re: How to get the sdcard handler in the ADF read MP3 from sdcard example
Hi,
did you ever figure this out?
I'm running into the same issue.
Doug
did you ever figure this out?
I'm running into the same issue.
Doug
-
- Posts: 40
- Joined: Wed Jun 22, 2022 12:10 pm
Re: How to get the sdcard handler in the ADF read MP3 from sdcard example
You do not need to get sdcard handle.
You can call function in <stdio.h> directly to operate open, read, close file action using fopen, fclose etc.
You can call function in <stdio.h> directly to operate open, read, close file action using fopen, fclose etc.
Re: How to get the sdcard handler in the ADF read MP3 from sdcard example
Just a note, you have to but "/sdcard/" in front of the file name
FILE *demo = fopen("/sdcard/demo.txt", "w+");
printf("demo = %u\n", (uint32_t)demo);
fprintf(demo, "This is a test");
fclose(demo);
works and creates a file on the SD Card.
Thank you so much.
Doug
FILE *demo = fopen("/sdcard/demo.txt", "w+");
printf("demo = %u\n", (uint32_t)demo);
fprintf(demo, "This is a test");
fclose(demo);
works and creates a file on the SD Card.
Thank you so much.
Doug
Who is online
Users browsing this forum: No registered users and 52 guests