Do you know how to write to a file on SD card? If not, start with that. If yes, duplicate your code and instead of using Serial, use the file handle returned by SD.open().
Do you know how to write to a file on SD card? If not, start with that. If yes, duplicate your code and instead of using Serial, use the file handle returned by SD.open().