Author Topic: c code to write to the usb flash drive on DP7xx display  (Read 4626 times)

Offline techn0

  • PLUS+1 Novice
  • *
  • Posts: 1
  • Karma: +0/-0
c code to write to the usb flash drive on DP7xx display
« on: March 21, 2024, 03:12:35 PM »
I have used applog and that works fine but I want to have complete control over the arrangement of the saved CSV file so I am trying to write to the usb flash drive file from C
Code: [Select]
if (BXPulse==true)
{
      FILE *file = fopen("usb:/data.csv", "w");
      int variable1=2;
      int variable2=4;
      int variable3=6;
      if (file != NULL) {
          // Write CSV headers
          fprintf(file, "Variable1,Variable2,Variable3\n");
 
          // Write data (replace with your actual variables)
          fprintf(file, "%f,%f,%f\n", variable1, variable2, variable3);
 
          // Close the file
          fclose(file);
      } else {
          // Handle error opening file
      }
}
Using something like this.  I do not know exactly what to put in the fopen line.  Any help would be appreciated.

Thanks