How to write EDF files from an Arduino

528 Views Asked by At

I have put together an ECG (electrocardiography) device based on an Olimexino STM32 with ECG shield + body leads, and I have successfully monitored my heart using the PC software BrainBay as a front-end of the electronics.

Now I want to be able to carry my ECG device with me at all times and record the data on a SD to play it back on BrainBay when I get home. I have tried recording the incoming data to a file in BrainBay, and then opening that file straight into an oscilloscope but the data is strangely read as digital values so that's no good.

It looks like the only way to do that is to write in the SD card an EDF file (European Data Format), of which I found this description. This description and some example files I have found online seem to indicate the header is plain ASCII, while the recorded data is binary.

I will be using the SdFat library for MapleIDE, which includes the method SdFile::write(char *buf, size_t size) - does that mean it is as simple as writing strings, then bytes one after another?

1

There are 1 best solutions below

0
On

This is to confirm that this is indeed as simple as writing text then binary data, as my ECG logger now functions properly.