Data logging shield with RFID PN532 Shield

Hi everyone,

I stacked a RFID shield with a data logging shield and wanted to use an SD card to log the data every time the RFID reader detects an RFID tag. I just merged the code together and was trying to create a new file in the SD card but I got stuck. On the serial monitor it says " Initializing SD card...card initialized. error: couldn't create file". Why wasn't it able to create the file and how do I fix this?

Thanks for your help!

Post your code using code tags.

I'm really new to all of this, so that's why I'm not sure what I'm doing wrong. I basically wanted to log the time and the ID number every time the RFID reader detects a RFID tag. The code is really long, so I have attached it in this link:[code]#include <SPI.h>#include <SD.h>#include <Wire.h>#include <RTClib.h -

Thanks for your help!