Help with combining 2 sketches together.

You are using an SD card reader/writer. That is an SPI device. That means that it uses pins 11, 12, and 13. That means you can NOT use the onboard LED for ANYTHING. Or pin 13.