Someone can help me figure out why the IRremote Library doesn't work with SDcard

I’m tring to use IRremote Library with the SD card library but it doesn’t work, even if I just import the IRremote library, the SD card stops to work immediately anyone knows why?

Here’s some code which i’m working with.

NOTE: IF I COMMENT THE LINE “#include <IRremote.h>” it works, can ANYONE help me pleaseee

web_server_IO.zip (9.59 KB)

Lots of IR libraries consume CPU by looping tightly to decode the IR. This can mess with other time sensitive libraries. Do not know if this is your specific problem, but it has been once for me. My solution was to offload the IR completely:

http://www.hackster.io/rayburne/infrared-dedicated-decoder

Ray

Possibly the IR remote library and SD library use the same timer.

Here's some code which i'm working with.

Why put your code in the rubbish bin when you can use the "Attachments and other options" link below this window to attach your code here?

You'll find more people willing to look at your code if you put it here.

Besides, your "link" isn't a link. Use the Insert a link icon when pasting URLs until the problem gets fixed.

Lukkasss: Here's some code which i'm working with.

http://pastebin.com/Fth9Lftb

As PaulS says, make an attachment.

How to use this forum

Sry, didn't know that I was able to attach code...

About the problem, if the IR Library uses the same timer, how can I work-around that? I need to use both, the SD Library to printout the webpage that has the commands. And I would like to turn on/off the TV using it...

Any advices other than offload the IR Library?

PS: I've attached the code on first post

    Serial.println("Initializing SD card...");
    if (!SD.begin(4)) {
        Serial.println("ERROR - SD card initialization failed!");
        return;    // init failed
    }
    Serial.println("SUCCESS - SD card initialized.");
    // check for index.htm file
    if (!SD.exists("index.htm")) {
        Serial.println("ERROR - Can't find index.htm file!");
        return;  // can't find index file
    }
    Serial.println("SUCCESS - Found index.htm file.");

I'm going to guess that you are running out of memory. I doubt that your problem has anything to do with timers or interrupts or anything other than poor programming.

You could be using the F() macro to keep all the string literals out of SRAM and save a bunch of space just in that snippet.

Serial.println(F("Initializing SD card..."));

PaulS:     Serial.println("Initializing SD card...");     if (!SD.begin(4)) {         Serial.println("ERROR - SD card initialization failed!");         return;    // init failed     }     Serial.println("SUCCESS - SD card initialized.");     // check for index.htm file     if (!SD.exists("index.htm")) {         Serial.println("ERROR - Can't find index.htm file!");         return;  // can't find index file     }     Serial.println("SUCCESS - Found index.htm file.");

I'm going to guess that you are running out of memory. I doubt that your problem has anything to do with timers or interrupts or anything other than poor programming.

You could be using the F() macro to keep all the string literals out of SRAM and save a bunch of space just in that snippet.

Serial.println(F("Initializing SD card..."));

Thanks you very very much!

That worked pretty well!

I should use F() macro in every print that's literally inside the quotes(") and isn't formatted?

I should use F() macro in every print that's literally inside the quotes(") and isn't formatted?

Yes.