danb35:
This part:logFile.print("LogFile cannot be opened");Doesn't look like it will work--if the log file can't be opened, how are you going to print the error message to the log file?
oh my, it must be Serial.println
anyway tried doing that. but still no data was being stored on the file name DATALOG.CSV
i wonder because when i use string it actually works, the only problem is that the data keep repeating so there's a lot of data being stored