SD card writing

Hi,
Let us know some more details such as;
Arduino IDE version,
Type of Arduino,
Also the condition of your SD card, did you try with it freshly formatted to say FAT16 ?

Things to try if you haven't already;
Prove that that Arduino will communicate well with just a simple serial sketch first with no usual output, checking your serial parameters are correct,
Then try the same program above with the SD card inserted.

Rockwallaby . . .