void loop() does not seem to begin running

Hey, all. I'm trying to make a datalogger out of an Arduino. I can read from a sensor and write those values to an LCD screen just fine. However, as soon as I introduce SD card-related code into my program, it never progresses past void setup(). The SD library I'm using is the SdFat library by greiman (https://github.com/greiman/SdFat). I am using SPI to control a 16x2 LCD, and I ensured that the proper slave select pin would be selected depending on whether the lcd is being written to or the SD card module is, so the LCD is not having any problems. It is just that everything freezes after line 87 and does not go any further.

I am positive there is nothing wrong with my SD card module or SD card, since I just tested it with the ReadWriteSdFat example from the SdFat library and it worked just fine. However, I noticed that in most of the SD examples that there is no code in void loop();.

It seems to freeze on LCDwrite("SD Card", "Initialized");, which is line 87 on the github link below.

Does anyone know why this is the case, and why some examples incorporating SD cards contain code in void loop() and others do not?

Here's my code so far: https://github.com/lukepadlp/Arduino-Datalogger-for-Vernier-Conductivity-Meter/blob/master/DataLogger/DataLogger.ino

I suspect too much String.

You did not read the stickies at the top of the forum, did you?


your   lcd.begin(16,2); //Initializes LCD with # of rows and columns will already start messing around with the select pin and do a digitalWrite(_rs_pin, LOW); so you should try also wit the proper slave select pin before starting the SD