This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to read and write files in CCS v6

I am using Code Composer  Version: 6.1.0.00104. I am running code on the CC2650DK.

I created a minimum empty project for CC2650DK and entered this code:

#include <stdio.h>

int main(void)
{

    FILE *fp;
 
    fp = fopen("testfile.txt", "w+");
    fprintf(fp, "%s %s %s %d", "We", "are", "in", 2015);

    fclose(fp);

}

The code runs without error and the file testfile.txt is created in the project Debug folder. However testfile.txt is empty.

What do I need to do to capture sensor data into a file for analysis? This would be extremely helpful for using tools

such as  MATLAB to create algorithms to process sensor data in real time.