I have a project where I want to press a button multiple times, depending on the number of times I press the button, a certain function happens.
slow down. if you want to press the button multiple times and depending on the number of times, a certain function happens, then get one thing going at a time.
have you successfully wired up 3 LED's and then got each to light, depending on how you pressed the button ?
you cannot just load button and one led and then jump to reading SD cards.
write your own code to get one led to light when you press the button one time, then get a different LED to light when you press the button a second time, and then get a 3rd LED to light wen you press it a 3rd time, then all off when you press it a 4th time.
once you have that, then you have 4 places you can add code to make things happen.
once you have that, save that and open a completely blank sketch and do what you need to do on your SD card, record or play. just use a simple switch.
once you have that function working, copy it and paste it when ONE led was being lit and get it to work in ONE of the places the button will light an LED.
that would be a major milestone. it would also give you more places to add more code.