What MCU/Processor/Board and compiler are you using?
ESP32
What do you want to achieve?
Populate the dropdown list with the directory list of files from spiffs directory.
What have you tried so far?
I followed the example code from the documentation. Saw that the hardcoded list items are just text with the \n separator between them. I tried making a string out of the directory list and got into trouble inserting the \n. Spent half a day solving it but eventually got over it only to find out that the list should be a pointer object.
My question is: is there a better way of populating the dropdown list rather than using the method i made?
Code to reproduce
The code block(s) should be formatted like:
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
Thanks rohmer! really appreciate it.
Your pulling me to deeper water too soon I’m barely a month here with no formal programming training. I was digesting you code and it seems like it is almost the same as the sample file on SPIFFS. The last two lines in your code are i think what’s important.
Thanks Trident. Im aware of that. The source code was from espressifs own sample file. Just the same im still figuring out how to get them in the drop down list.
i have to make a pointer to the buffer cause the compiler throws an char* to char error. i guess it is caused by the file.name() function of the file system.
anyway, i am sending the buffer to the serial monitor and the result turns out ok. its not loading on the ddlist correctly though. upon checking the value of the reference variable the first few chars are ok then some garbled text. working on it right now.
a few more pointers , pun intended, will be greatly appreciated.
regards.