Go Down

Topic: Writing a binary file to SD. (Read 1 time) previous topic - next topic


I am trying to build a data logger but rather than using a text file I want it to use a binary file. Is there a library that is available that can already do binary file writes similar to that of C/C++. The plan is to just have the Arduino append the senor readings onto a file contained on a SD card. Then I can pull the SD card and use a computer program, most likely written in C++, to analyze the data.


In the SD library, the function to write to a file takes as an argument a const void * (a pointer to the data, of any type, to write to the file).

If doesn't care what is in that array - binary or ascii (not that there is really a difference). It just copies the data to the file.


This is true of pretty much all filesystems on all operating systems I know of...  A file is a vector of bytes, nothing in the filesystem code should care what those bytes are, or what they represent.  To the filesystem code "binary file" and "text file" is a meaningless distinction.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131