cancel
Showing results for 
Search instead for 
Did you mean: 

Logging a Variable Using USB Mass Storage Mode

AKh.1
Associate II

Hi guys,

On USB Host Mass storage mode, I am creating a text file using (f_open(&myFile, "TEST2.TXT", FA_WRITE | FA_CREATE_ALWAYS function.

For writing text into the file, I use sprintf(rwtext, "Hello World"); function to write the text into the txt file.

Now, What function should I use if I want to log a "variable" that is changing from time to time and write it as a text in a txt file? (Like, X is an input voltage that's changing frequently, and I would like to log this voltage value and save it in a column as txt file in ).

Any help is highly appreciated on this.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The typical way is to use sprintf to print the variable to a local string buffer, and then send that buffer to the SD card.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

The typical way is to use sprintf to print the variable to a local string buffer, and then send that buffer to the SD card.

If you feel a post has answered your question, please click "Accept as Solution".