The SD card is an SPI device. On a 328-based Arduino, that means that it uses pins 10, 11, 12, and 13 AND that you can't use those pins for ANYTHING else.
You are currently trying to use pin 13 for 3 different purposes. Get real.
The SD card is an SPI device. On a 328-based Arduino, that means that it uses pins 10, 11, 12, and 13 AND that you can't use those pins for ANYTHING else.
You are currently trying to use pin 13 for 3 different purposes. Get real.