sd.h causing output pins to stop working

I have been working on a morse code program that will flash an led on pin 13 and also connect to my phone via bluetooth (pin 0/1) to send a new message for the program to decode and flash.
I recently got the Ethernet shield and was excited about the SD card slot. I put it on and tried a few of the examples first to get a feel for it, then all I did was add a few lines to my original program and now any pin that I setup will not flash the LED. I changed the led pin to 2 now and found out that by removing the (#include <SD.h>) from the program the led flashes but it I add it the led stops working. And this will happen for any pin that I select. Now it seems odd just by adding one line to a program will stop all output pin traffic.

All I added to my program was:

#include <SD.h>
void setup(){
 pinMode(10, OUTPUT);
 if (!SD.begin(4)) {
  Serial.println("initialization failed!");
 }
}

And if you must know I am using the Arduino Uno R3, Ethernet Shield R3, Developer Software 1.0

Any ideas of why this might be happening please. I wanna take this in and show the guys at work.

I changed the led pin to 2 now and found out that by removing the (#include <SD.h>) from the program the led flashes but it I add it the led stops working.

Where, in that code, are you defining pin 2 to be an output pin?

I meant to say in that sentence "... flashes but it I add it the led ..." it is suppose to be "when"

I am changing it in my program here
#define LEDPin 2
after I call the include

When I said changed to pin 2 I meant that that is the current pin that it is on as of now.

I know this is hard to understand without me showing you my whole code but I prefer not to display it yet.

I am changing it in my program here
#define LEDPin 2
after I call the include

Saying "I am going to talk to pin 2" and saying "pinMode(2, OUTPUT);" are not quite the same thing, are they?

If you want to turn an LED on, you must connect it to a pin whose mode is OUTPUT. The pins are all INPUT by default.

PaulS:

I am changing it in my program here
#define LEDPin 2
after I call the include

Saying "I am going to talk to pin 2" and saying "pinMode(2, OUTPUT);" are not quite the same thing, are they?

If you want to turn an LED on, you must connect it to a pin whose mode is OUTPUT. The pins are all INPUT by default.

you don't know what I am talking about and your starting to get off topic. I am having a problem with #include <SD.h>

In my program I use #define LEDPin 2 as a constant so I am not repeating changes several times in my program. So be more specific:

At the start I have

#include <SD.h>
#define LEDPin 2

In setup() I have

pinMode(LEDPin, OUTPUT);
pinMode(10, OUTPUT);
if (!SD.begin(4)) {
  Serial.println("initialization failed!");
}

And in loop() I have a bunch of things that make the LED go ON and OFF

Now to get back on topic the problem is that as soon as I add any code related to the SD Library (even the include statement) my led will stop working no matter what pin I have it on.

Sounds crazy, but do you actually have an SD card in the slot?

sd.h library may be taking control of the SPI pins D11-12-13, and expecting one other to be an output for Chip Select.
Don't know why that would affect other pins.

you don't know what I am talking about and your starting to get off topic. I am having a problem with #include <SD.h>

I know what you are talking about, and while what I'm saying might be off topic, it is still relevant.

In setup() I have

Show me where, in your initial post, you have a pinMode statement that references LEDPin.

You've added one in this code, which is what I was trying to get you to do.

I have also the same problem =( =( =( when i'm trying to combine tvout(which uses output pin)with the sd.h or other sd libraries.
When i put the sd library,the tvout demoPAL stop playing.After searching a lot,i found that someone found a solution
to make the output pins working the output pins
but i can't understand what is he saying...Could anyone help???

link:http://code.google.com/p/arduino-tvout/issues/detail?id=40

Just adding SD.h takes over 500 bytes of additional RAM and this may cause your program to fail if you are already using a lot of RAM. I think tvout can use lots of RAM.

All SD libraries that write to files need a 512 byte SD block buffer for rewriting SD blocks in file structures.

fat16lib:
Just adding SD.h takes over 500 bytes of additional RAM and this may cause your program to fail if you are already using a lot of RAM.

So if this is the case, how do you free up some ram without affecting my functional program.
I just checked when I compile that my program is saying "Binary sketch size: 9378 bytes (of a 32256 byte maximum)" and when I add the include SD.h the output is "Binary sketch size: 13412 bytes (of a 32256 byte maximum)"

apple32:
I have also the same problem =( =( =( when i'm trying to combine tvout(which uses output pin)with the sd.h or other sd libraries.
When i put the sd library,the tvout demoPAL stop playing.After searching a lot,i found that someone found a solution
to make the output pins working the output pins
but i can't understand what is he saying...Could anyone help???

link:Google Code Archive - Long-term storage for Google Code Project Hosting.

I checked that out and I understand what he is doing but I don't know what parts of the SD library he changed.