how to write data with high sampling rates to a SD-Card

Using SdFat will allow you to log analog data VERY FAST! you may have to select pin 4 instead of SS depending on the SD shield you use.

This is an awesome library. I logged 5kHz on 2 channels, and the measurements can go even faster!

I am trying to use SdFat (connected to pins 10-13) with the nRF8001 BLE (connected to pins 50-53 using Adafruit library) with my Arduino Mega, but having trouble. Seems like being located on 2 separate set of pins would alleviate the issue, but I don't know what is wrong.

Any suggestions? Seems versions of both library with SPI transactions exist, but I am not sure how to use it. Any pointers? I am concerned for the SDFat library called within a BLE loop, will result in dropped BLE connection.

while BLE.available(): //from the BLE library
case1:
logData() // from the SdFat library
case2:
dumpdata() //access BLE and SdFat simultaneously or looping til done :o